home *** CD-ROM | disk | FTP | other *** search
/ Internet Info 1994 March / Internet Info CD-ROM (Walnut Creek) (March 1994).iso / inet / internet-drafts / draft-ietf-cat-secservice-02.txt < prev    next >
Text File  |  1993-03-03  |  104KB  |  3,035 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.    IETF-CATWG                                                 J. Wray (DEC)
  7.    Internet draft                                                March 1993
  8.  
  9.  
  10.  
  11.                   Generic Security Service API : C-bindings
  12.  
  13.  
  14.    1. STATUS OF THIS MEMO
  15.  
  16.       This document is an Internet Draft.  Internet Drafts are working
  17.       documents of the Internet Engineering Task Force (IETF), its Areas,
  18.       and its Working Groups.  Note that other groups may also distribute
  19.       working documents as Internet Drafts.  Internet Drafts are draft
  20.       documents valid for a maximum of six months. Internet Drafts may be
  21.       updated, replaced, or obsoleted by other documents at any time.  It
  22.       is not appropriate to use Internet Drafts as reference material or to
  23.       cite them other than as a "working draft" or "work in progress."
  24.       Please check the I-D abstract listing contained in each Internet
  25.       Draft directory to learn the current status of this or any other
  26.       Internet Draft.
  27.  
  28.       This draft document will be submitted to the RFC editor as a proposed
  29.       interface specification for use by integrators of security features
  30.       into caller protocols. Distribution of this memo is unlimited. Please
  31.       send comments to "cat-ietf@MIT.EDU."
  32.  
  33.  
  34.    2. ABSTRACT
  35.  
  36.       This draft document specifies C language bindings for the Generic
  37.       Security Service Application Program Interface (GSS-API), which is
  38.       described at a language-independent conceptual level in other drafts.
  39.  
  40.       The Generic Security Service Application Programming Interface (GSS-
  41.       API) provides security services to its callers, and is intended for
  42.       implementation atop alternative underlying cryptographic mechanisms.
  43.       Typically, GSS-API callers will be application protocols into which
  44.       security enhancements are integrated through invocation of services
  45.       provided by the GSS-API. The GSS-API allows a caller application to
  46.       authenticate a principal identity associated with a peer application,
  47.       to delegate rights to a peer, and to apply security services such as
  48.       confidentiality and integrity on a per-message basis.
  49.  
  50.  
  51.    3. INTRODUCTION
  52.  
  53.       The Generic Security Service Application Programming Interface
  54.       [GSSAPI] provides security services to calling applications.  It
  55.       allows a communicating application to authenticate the user
  56.       associated with another application, to delegate rights to another
  57.  
  58.  
  59.  
  60.    Wray             Document Expiration: 31 September 1993         [Page 1]
  61.  
  62.  
  63.  
  64.  
  65.  
  66.  
  67.  
  68.    INTERNET-DRAFT      GSSAPI - Overview and C bindings          March 1993
  69.  
  70.  
  71.  
  72.       application, and to apply security services such as confidentiality
  73.       and integrity on a per-message basis.
  74.  
  75.       There are four stages to using the GSSAPI:
  76.  
  77.         (a) The application acquires a set of credentials with which it may
  78.             prove its identity to other processes.  The application's
  79.             credentials vouch for its global identity, which may or may not
  80.             be related to the local username under which it is running.
  81.  
  82.         (b) A pair of communicating applications establish a joint security
  83.             context using their credentials.  The security context is a
  84.             pair of GSSAPI data structures that contain shared state
  85.             information, which is required in order that per-message
  86.             security services may be provided.  As part of the
  87.             establishment of a security context, the context initiator is
  88.             authenticated to the responder, and may require that the
  89.             responder is authenticated in turn.  The initiator may
  90.             optionally give the responder the right to initiate further
  91.             security contexts.  This transfer of rights is termed
  92.             delegation, and is achieved by creating a set of credentials,
  93.             similar to those used by the originating application, but which
  94.             may be used by the responder.  To establish and maintain the
  95.             shared information that makes up the security context, certain
  96.             GSSAPI calls will return a token data structure, which is a
  97.             cryptographically protected opaque data type.  The caller of
  98.             such a GSSAPI routine is responsible for transferring the token
  99.             to the peer application, which should then pass it to a
  100.             corresponding GSSAPI routine which will decode it and extract
  101.             the information.
  102.  
  103.         (c) Per-message services are invoked to apply either:
  104.  
  105.               (i) integrity and data origin authentication, or
  106.  
  107.              (ii) confidentiality, integrity and data origin authentication
  108.  
  109.             to application data, which are treated by GSSAPI as arbitrary
  110.             octet-strings.  The application transmitting a message that it
  111.             wishes to protect will call the appropriate GSSAPI routine
  112.             (sign or  seal) to apply protection, specifying the appropriate
  113.             security context, and send the result to the receiving
  114.             application.  The receiver will pass the received data to the
  115.             corresponding decoding routine (verify or unseal) to remove the
  116.             protection and validate the data.
  117.  
  118.         (d) At the completion of a communications session (which may extend
  119.             across several connections), the peer applications call GSSAPI
  120.             routines to delete the security context.  Multiple contexts may
  121.             also be used (either successively or simultaneously) within a
  122.             single communications association.
  123.  
  124.  
  125.  
  126.    Wray             Document Expiration: 31 September 1993         [Page 2]
  127.  
  128.  
  129.  
  130.  
  131.  
  132.  
  133.  
  134.    INTERNET-DRAFT      GSSAPI - Overview and C bindings          March 1993
  135.  
  136.  
  137.  
  138.    4. GSSAPI Routines
  139.  
  140.       This section lists the functions performed by each of the GSSAPI
  141.       routines and discusses their major parameters, describing how they
  142.       are to be passed to the routines.  The routines are listed in figure
  143.       4-1.
  144.  
  145.                       Figure 4-1  GSSAPI Routines
  146.  
  147.  
  148.             Routine                               Function
  149.  
  150.             gss_acquire_cred               Assume a global identity
  151.  
  152.             gss_release_cred               Discard credentials
  153.  
  154.             gss_init_sec_context           Initiate a security context
  155.                                            with a peer application
  156.  
  157.             gss_accept_sec_context         Accept a security context
  158.                                            initiated by a peer
  159.                                            application
  160.  
  161.             gss_process_context_token      Process a token on a security
  162.                                            context from a peer
  163.                                            application
  164.  
  165.             gss_delete_sec_context         Discard a security context
  166.  
  167.             gss_context_time               Determine for how long a
  168.                                            context will remain valid
  169.  
  170.             gss_sign                       Sign a message; integrity
  171.                                            service
  172.  
  173.             gss_verify                     Check signature on a message
  174.  
  175.             gss_seal                       Sign (optionally encrypt) a
  176.                                            message; confidentiality
  177.                                            service
  178.  
  179.             gss_unseal                     Verify (optionally decrypt)
  180.                                            message
  181.  
  182.             gss_display_status             Convert an API status code
  183.                                            to text
  184.  
  185.             gss_indicate_mechs             Determine underlying
  186.                                            authentication mechanism
  187.  
  188.             gss_compare_name               Compare two internal-form names
  189.  
  190.  
  191.  
  192.    Wray             Document Expiration: 31 September 1993         [Page 3]
  193.  
  194.  
  195.  
  196.  
  197.  
  198.  
  199.  
  200.    INTERNET-DRAFT      GSSAPI - Overview and C bindings          March 1993
  201.  
  202.  
  203.  
  204.             gss_display_name               Convert opaque name to text
  205.  
  206.             gss_import_name                Convert a textual name to
  207.                                            internal-form
  208.  
  209.             gss_release_name               Discard an internal-form  name
  210.  
  211.             gss_release_buffer             Discard a buffer
  212.  
  213.             gss_release_oid_set            Discard a set of object
  214.                                            identifiers
  215.  
  216.             gss_inquire_cred               Determine information about
  217.                                            a credential
  218.  
  219.       Individual GSSAPI implementations may augment these routines by
  220.       providing additional mechanism-specific routines if required
  221.       functionality is not available from the generic forms.  Applications
  222.       are encouraged to use the generic routines wherever possible on
  223.       portability grounds.
  224.  
  225.    4.1. Data Types and Calling Conventions
  226.  
  227.       The following conventions are used by the GSSAPI:
  228.  
  229.    4.1.1. Structured data types
  230.  
  231.       Wherever these GSSAPI C-bindings describe structured data, only
  232.       fields that must be provided by all GSSAPI implementation are
  233.       documented.  Individual implementations may provide additional
  234.       fields, either for internal use within GSSAPI routines, or for use by
  235.       non-portable applications.
  236.  
  237.    4.1.2. Integer types
  238.  
  239.       GSSAPI defines the following integer data type:
  240.  
  241.                  OM_uint32      32-bit unsigned integer
  242.  
  243.       Where guaranteed minimum bit-count is important, this portable data
  244.       type is used by the GSSAPI routine definitions. Individual GSSAPI
  245.       implementations will include appropriate typedef definitions to map
  246.       this type onto a built-in data type.
  247.  
  248.    4.1.3. String and similar data
  249.  
  250.       Many of the GSSAPI routines take arguments and return values that
  251.       describe contiguous multiple-byte data.  All such data is passed
  252.       between the GSSAPI and the caller using the gss_buffer_t data type.
  253.       This data type is a pointer to a buffer descriptor, which consists of
  254.       a length field that contains the total number of bytes in the datum,
  255.  
  256.  
  257.  
  258.    Wray             Document Expiration: 31 September 1993         [Page 4]
  259.  
  260.  
  261.  
  262.  
  263.  
  264.  
  265.  
  266.    INTERNET-DRAFT      GSSAPI - Overview and C bindings          March 1993
  267.  
  268.  
  269.  
  270.       and a value field which contains a pointer to the actual datum:
  271.  
  272.                  typedef struct gss_buffer_desc_struct {
  273.                     size_t  length;
  274.                     void    *value;
  275.                  } gss_buffer_desc, *gss_buffer_t;
  276.  
  277.       Storage for data passed to the application by a GSSAPI routine using
  278.       the gss_buffer_t conventions is allocated by the GSSAPI routine.  The
  279.       application may free this storage by invoking the gss_release_buffer
  280.       routine.  Allocation of the gss_buffer_desc object is always the
  281.       responsibility of the application;  Unused gss_buffer_desc objects
  282.       may be initialized to the value GSS_C_EMPTY_BUFFER.
  283.  
  284.    4.1.3.1. Opaque data types
  285.  
  286.       Certain multiple-word data items are considered opaque data types at
  287.       the GSSAPI, because their internal structure has no significance
  288.       either to the GSSAPI or to the caller.  Examples of such opaque data
  289.       types are the input_token parameter to gss_init_sec_context (which is
  290.       opaque to the caller), and the input_message parameter to   gss_seal
  291.       (which is opaque to the GSSAPI).  Opaque data is passed between the
  292.       GSSAPI and the application using the gss_buffer_t datatype.
  293.  
  294.    4.1.3.2. Character strings
  295.  
  296.       Certain multiple-word data items may be regarded as simple ISO
  297.       Latin-1 character strings.  An example of this is the
  298.       input_name_buffer parameter to gss_import_name.  Some GSSAPI routines
  299.       also return character strings.  Character strings are passed between
  300.       the application and the GSSAPI using the gss_buffer_t datatype,
  301.       defined earlier.
  302.  
  303.    4.1.4. Object Identifiers
  304.  
  305.       Certain GSSAPI procedures take parameters of the type   gss_OID, or
  306.       Object identifier.  This is a type containing ISO-defined tree-
  307.       structured values, and is used by the GSSAPI caller to select an
  308.       underlying security mechanism.  A value of type gss_OID has the
  309.       following structure:
  310.  
  311.                  typedef struct gss_OID_desc_struct {
  312.                     OM_uint32 length;
  313.                     void      *elements;
  314.                  } gss_OID_desc, *gss_OID;
  315.  
  316.       The elements field of this structure points to the first byte of an
  317.       octet string containing the ASN.1 BER encoding of the value of the
  318.       gss_OID.  The length field contains the number of bytes in this
  319.       value.  For example, the  gss_OID value corresponding to {iso(1)
  320.       identified- organization(3) icd-ecma(12) member-company(2) dec(1011)
  321.  
  322.  
  323.  
  324.    Wray             Document Expiration: 31 September 1993         [Page 5]
  325.  
  326.  
  327.  
  328.  
  329.  
  330.  
  331.  
  332.    INTERNET-DRAFT      GSSAPI - Overview and C bindings          March 1993
  333.  
  334.  
  335.  
  336.       cryptoAlgorithms(7) SPX(5)} meaning SPX (Digital's X.509
  337.       authentication mechanism) has a length field of 7 and an elements
  338.       field pointing to seven octets containing the following octal values:
  339.       53,14,2,207,163,7,5. GSSAPI implementations should provide constant
  340.       gss_OID values to allow callers to request any supported mechanism,
  341.       although applications are encouraged on portability grounds to accept
  342.       the default mechanism.   gss_OID values should also be provided to
  343.       allow applications to specify particular name types (see section
  344.       4.1.10).  Applications should treat gss_OID_desc values returned by
  345.       GSSAPI routines as read-only.  In particular, the application should
  346.       not attempt to deallocate them.  The gss_OID_desc datatype is
  347.       equivalent to the X/Open OM_object_identifier datatype[XOM].
  348.  
  349.    4.1.5. Object Identifier Sets
  350.  
  351.       Certain GSSAPI procedures take parameters of the type gss_OID_set.
  352.       This type represents one or more object identifiers (section 4.1.4).
  353.       A gss_OID_set object has the following structure:
  354.  
  355.                  typedef struct gss_OID_set_desc_struct {
  356.                     int       count;
  357.                     gss_OID   elements;
  358.                  } gss_OID_set_desc, *gss_OID_set;
  359.  
  360.       The count field contains the number of OIDs within the set.  The
  361.       elements field is a pointer to an array of gss_OID_desc objects, each
  362.       of which describes a single OID. gss_OID_set values are used to name
  363.       the available mechanisms supported by the GSSAPI, to request the use
  364.       of specific mechanisms, and to indicate which mechanisms a given
  365.       credential supports.  Storage associated with gss_OID_set values
  366.       returned to the application by the GSSAPI may be deallocated by the
  367.       gss_release_oid_set routine.
  368.  
  369.    4.1.6. Credentials
  370.  
  371.       A credential handle is a caller-opaque atomic datum that identifies a
  372.       GSSAPI credential data structure.  It is represented by the caller-
  373.       opaque type gss_cred_id_t, which may be implemented as either an
  374.       arithmetic or a pointer type.  Credentials describe a principal, and
  375.       they give their holder the ability to act as that principal.  The
  376.       GSSAPI does not make the actual credentials available to
  377.       applications; instead the credential handle is used to identify a
  378.       particular credential, held internally by GSSAPI or underlying
  379.       mechanism.  Thus the credential handle contains no security-relavent
  380.       information, and requires no special protection by the application.
  381.       Depending on the implementation, a given credential handle may refer
  382.       to different credentials when presented to the GSSAPI by different
  383.       callers.  Individual GSSAPI implementations should define both the
  384.       scope of a credential handle and the scope of a credential itself
  385.       (which must be at least as wide as that of a handle).  Possibilities
  386.       for credential handle scope include the process that acquired the
  387.  
  388.  
  389.  
  390.    Wray             Document Expiration: 31 September 1993         [Page 6]
  391.  
  392.  
  393.  
  394.  
  395.  
  396.  
  397.  
  398.    INTERNET-DRAFT      GSSAPI - Overview and C bindings          March 1993
  399.  
  400.  
  401.  
  402.       handle, the acquiring process and its children, or all processes
  403.       sharing some local identification information (e.g., UID).  If no
  404.       handles exist by which a given credential may be reached, the GSSAPI
  405.       may delete the credential.
  406.  
  407.       Certain routines allow credential handle parameters to be omitted to
  408.       indicate the use of a default credential.  The mechanism by which a
  409.       default credential is established and its scope should be defined by
  410.       the individual GSSAPI implementation.
  411.  
  412.    4.1.7. Contexts
  413.  
  414.       The gss_ctx_id_t data type contains a caller-opaque atomic value that
  415.       identifies one end of a GSSAPI security context.  It may be
  416.       implemented as either an arithmetic or a pointer type. Depending on
  417.       the implementation, a given gss_ctx_id_t value may refer to different
  418.       GSSAPI security contexts when presented to the GSSAPI by different
  419.       callers.  The security context holds state information about each end
  420.       of a peer communication, including cryptographic state information.
  421.       Individual GSSAPI implementations should define the scope of a
  422.       context.  Since no way is provided by which a new gss_ctx_id_t value
  423.       may be obtained for an existing context, the scope of a context
  424.       should be the same as the scope of a gss_ctx_id_t.
  425.  
  426.    4.1.8. Authentication tokens
  427.  
  428.       A token is a caller-opaque type that GSSAPI uses to maintain
  429.       synchronization between the context data structures at each end of a
  430.       GSSAPI security context.  The token is a cryptographically protected
  431.       bit-string, generated by the underlying mechanism at one end of a
  432.       GSSAPI security context for use by the peer mechanism at the other
  433.       end.  Encapsulation (if required) and transfer of the token are the
  434.       responsibility of the peer applications.  A token is passed between
  435.       the GSSAPI and the application using the gss_buffer_t conventions.
  436.  
  437.    4.1.9. Status values
  438.  
  439.       One or more status codes are returned by each GSSAPI routine.  Two
  440.       distinct sorts of status codes are returned.  These are termed GSS
  441.       status codes and Mechanism status codes.
  442.  
  443.    4.1.9.1. GSS status codes
  444.  
  445.       GSSAPI routines return GSS status codes as their OM_uint32 function
  446.       value.  These codes indicate errors that are independent of the
  447.       underlying mechanism used to provide the security service.  The
  448.       errors that can be indicated via a GSS status code are either generic
  449.       API routine errors (errors that are defined in the GSSAPI
  450.       specification) or calling errors (errors that are specific to these
  451.       bindings).
  452.  
  453.  
  454.  
  455.  
  456.    Wray             Document Expiration: 31 September 1993         [Page 7]
  457.  
  458.  
  459.  
  460.  
  461.  
  462.  
  463.  
  464.    INTERNET-DRAFT      GSSAPI - Overview and C bindings          March 1993
  465.  
  466.  
  467.  
  468.       A GSS status code can indicate a single fatal generic API error from
  469.       the routine and a single calling error.  In addition, supplementary
  470.       status information may be indicated via the setting of bits in the
  471.       supplementary info field of a GSS status code.
  472.  
  473.       These errors are encoded into the 32-bit GSS status code as follows:
  474.  
  475.           MSB                                                        LSB
  476.           |------------------------------------------------------------|
  477.           | Calling Error | Routine Error  |    Supplementary Info     |
  478.           |------------------------------------------------------------|
  479.        Bit 31           24 23            16 15                        0
  480.  
  481.       Hence if a GSSAPI routine returns a GSS status code whose upper 16
  482.       bits contain a non-zero value, the call failed.  If the calling error
  483.       field is non-zero, the invoking application's call of the routine was
  484.       erroneous.  Calling errors are defined in table 5-1.  If the routine
  485.       error field is non-zero, the routine failed for one of the routine-
  486.       specific reasons listed below in table 5-2.  Whether or not the upper
  487.       16 bits indicate a failure or a success, the routine may indicate
  488.       additional information by setting bits in the supplementary info
  489.       field of the status code.  The meaning of individual bits is listed
  490.       below in table 5-3.
  491.  
  492.                      Table 5-1  Calling Errors
  493.  
  494.               Name                    Value in        Meaning
  495.                                         Field
  496.          GSS_S_CALL_INACCESSIBLE_READ     1           A required input
  497.                                                       parameter could
  498.                                                       not be read.
  499.          GSS_S_CALL_INACCESSIBLE_WRITE    2           A required output
  500.                                                       parameter could
  501.                                                       not be written.
  502.          GSS_S_CALL_BAD_STRUCTURE         3           A parameter was
  503.                                                       malformed
  504.  
  505.                      Table 5-2  Routine Errors
  506.  
  507.                Name             Value in       Meaning
  508.                                  Field
  509.  
  510.          GSS_S_BAD_MECH             1      An unsupported mechanism was
  511.                                            requested
  512.          GSS_S_BAD_NAME             2      An invalid name was supplied
  513.          GSS_S_BAD_NAMETYPE         3      A supplied name was of an
  514.                                            unsupported type
  515.          GSS_S_BAD_BINDINGS         4      Incorrect channel bindings
  516.                                            were supplied
  517.          GSS_S_BAD_STATUS           5      An invalid status code was
  518.                                            supplied
  519.  
  520.  
  521.  
  522.    Wray             Document Expiration: 31 September 1993         [Page 8]
  523.  
  524.  
  525.  
  526.  
  527.  
  528.  
  529.  
  530.    INTERNET-DRAFT      GSSAPI - Overview and C bindings          March 1993
  531.  
  532.  
  533.  
  534.          GSS_S_BAD_SIG              6      A token had an invalid
  535.                                            signature
  536.          GSS_S_NO_CRED              7      No credentials were supplied
  537.          GSS_S_NO_CONTEXT           8      No context has been
  538.                                            established
  539.          GSS_S_DEFECTIVE_TOKEN      9      A token was invalid
  540.          GSS_S_DEFECTIVE_CREDENTIAL 10     A credential was invalid
  541.          GSS_S_CREDENTIALS_EXPIRED  11     The referenced credentials
  542.                                            have expired
  543.          GSS_S_CONTEXT_EXPIRED      12     The context has expired
  544.          GSS_S_FAILURE              13     Miscellaneous failure
  545.                                            (see text)
  546.  
  547.                      Table 5-3  Supplementary Status Bits
  548.  
  549.          Name                Bit Number         Meaning
  550.          GSS_S_CONTINUE_NEEDED   0 (LSB)  The routine must be called
  551.                                           again to complete its function.
  552.                                           See routine documentation for
  553.                                           detailed description.
  554.          GSS_S_DUPLICATE_TOKEN   1        The token was a duplicate of
  555.                                           an earlier token
  556.          GSS_S_OLD_TOKEN         2        The token's validity period
  557.                                           has expired
  558.          GSS_S_UNSEQ_TOKEN       3        A later token has already been
  559.                                           processed
  560.  
  561.       The routine documentation also uses the name GSS_S_COMPLETE, which is
  562.       a zero value, to indicate an absence of any API errors or
  563.       supplementary information bits.
  564.  
  565.       All GSS_S_xxx symbols equate to complete OM_uint32 status codes,
  566.       rather than to bitfield values.  For example, the actual value of the
  567.       symbol GSS_S_BAD_NAMETYPE (value 3 in the routine error field) is
  568.       3 << 16.
  569.  
  570.       The macros GSS_CALLING_ERROR(), GSS_ROUTINE_ERROR() and
  571.       GSS_SUPPLEMENTARY_INFO() are provided, each of which takes a GSS
  572.       status code and removes all but the relevant field.  For example, the
  573.       value obtained by applying GSS_ROUTINE_ERROR to a status code removes
  574.       the calling errors and supplementary info fields, leaving only the
  575.       routine errors field.  The values delivered by these macros may be
  576.       directly compared with a GSS_S_xxx symbol of the appropriate type.
  577.       The macro GSS_ERROR() is also provided, which when applied to a GSS
  578.       status code returns a non-zero value if the status code indicated a
  579.       calling or routine error, and a zero value otherwise.
  580.  
  581.       A GSSAPI implementation may choose to signal calling errors in a
  582.       platform-specific manner instead of, or in addition to the routine
  583.       value;  routine errors and supplementary info should be returned via
  584.       routine status values only.
  585.  
  586.  
  587.  
  588.    Wray             Document Expiration: 31 September 1993         [Page 9]
  589.  
  590.  
  591.  
  592.  
  593.  
  594.  
  595.  
  596.    INTERNET-DRAFT      GSSAPI - Overview and C bindings          March 1993
  597.  
  598.  
  599.  
  600.    4.1.9.2. Mechanism-specific status codes
  601.  
  602.       GSSAPI routines return a minor_status parameter, which is used to
  603.       indicate specialized errors from the underlying security mechanism.
  604.       This parameter may contain a single mechanism-specific error,
  605.       indicated by a OM_uint32 value.
  606.  
  607.       The minor_status parameter will always be set by a GSSAPI routine,
  608.       even if it returns a calling error or one of the generic API errors
  609.       indicated above as fatal, although other output parameters may remain
  610.       unset in such cases.  However, output parameters that are expected to
  611.       return pointers to storage allocated by a routine must always set set
  612.       by the routine, even in the event of an error, although in such cases
  613.       the GSSAPI routine may elect to set the returned parameter value to
  614.       NULL to indicate that no storage was actually allocated.  Any length
  615.       field associated with such pointers (as in a gss_buffer_desc
  616.       structure) should also be set to zero in such cases.
  617.  
  618.       The GSS status code GSS_S_FAILURE is used to indicate that the
  619.       underlying mechanism detected an error for which no specific GSS
  620.       status code is defined.  The mechanism status code will provide more
  621.       details about the error.
  622.  
  623.    4.1.10. Names
  624.  
  625.       A name is used to identify a person or entity.  GSSAPI authenticates
  626.       the relationship between a name and the entity claiming the name.
  627.  
  628.       Two distinct representations are defined for names:
  629.  
  630.         (a) A printable form, for presentation to a user
  631.  
  632.         (b) An internal form, for presentation at the API
  633.  
  634.       The syntax of a printable name is defined by the GSSAPI
  635.       implementation, and may be dependent on local system configuration,
  636.       or on individual user preference.  The internal form provides a
  637.       canonical representation of the name that is independent of
  638.       configuration.
  639.  
  640.       A given GSSAPI implementation may support names drawn from multiple
  641.       namespaces.  In such an implementation, the internal form of the name
  642.       must include fields that identify the namespace from which the name
  643.       is drawn.  The namespace from which a printable name is drawn is
  644.       specified by an accompanying object identifier.
  645.  
  646.       Routines (gss_import_name and  gss_display_name) are provided to
  647.       convert names between their printable representations and the
  648.       gss_name_t type.  gss_import_name may support multiple syntaxes for
  649.       each supported namespace, allowing users the freedom to choose a
  650.       preferred name representation.  gss_display_name should use an
  651.  
  652.  
  653.  
  654.    Wray             Document Expiration: 31 September 1993        [Page 10]
  655.  
  656.  
  657.  
  658.  
  659.  
  660.  
  661.  
  662.    INTERNET-DRAFT      GSSAPI - Overview and C bindings          March 1993
  663.  
  664.  
  665.  
  666.       implementation-chosen preferred syntax for each supported name-type.
  667.  
  668.       Comparison of internal-form  names is accomplished via the
  669.       gss_compare_names routine.  This removes the need for the application
  670.       program to understand the syntaxes of the various printable names
  671.       that a given GSSAPI implementation may support.
  672.  
  673.       Storage is allocated by routines that return gss_name_t values.  A
  674.       procedure, gss_release_name, is provided to free storage associated
  675.       with a name.
  676.  
  677.    4.1.11. Channel Bindings
  678.  
  679.       GSSAPI supports the use of user-specified tags to identify a given
  680.       context to the peer application.  These tags are used to identify the
  681.       particular communications channel that carries the context.  Channel
  682.       bindings are communicated to the GSSAPI using the following
  683.       structure:
  684.  
  685.                  typedef struct gss_channel_bindings_struct {
  686.                     OM_uint32       initiator_addrtype;
  687.                     gss_buffer_desc initiator_address;
  688.                     OM_uint32       acceptor_addrtype;
  689.                     gss_buffer_desc acceptor_address;
  690.                     gss_buffer_desc application_data;
  691.                  } *gss_channel_bindings_t;
  692.  
  693.       The initiator_addrtype and acceptor_addrtype fields denote the type
  694.       of addresses contained in the initiator_address and acceptor_address
  695.       buffers.  The address type should be one of the following:
  696.  
  697.             GSS_C_AF_UNSPEC      Unspecified address type
  698.             GSS_C_AF_LOCAL       Host-local address type
  699.             GSS_C_AF_INET        DARPA Internet address type
  700.             GSS_C_AF_IMPLINK     ARPAnet IMP address type (eg IP)
  701.             GSS_C_AF_PUP         pup protocols (eg BSP) address type
  702.             GSS_C_AF_CHAOS       MIT CHAOS protocol address type
  703.             GSS_C_AF_NS          XEROX NS address type
  704.             GSS_C_AF_NBS         nbs address type
  705.             GSS_C_AF_ECMA        ECMA address type
  706.             GSS_C_AF_DATAKIT     datakit protocols address type
  707.             GSS_C_AF_CCITT       CCITT protocols (eg X.25)
  708.             GSS_C_AF_SNA         IBM SNA address type
  709.             GSS_C_AF_DECnet      DECnet address type
  710.             GSS_C_AF_DLI         Direct data link interface address type
  711.             GSS_C_AF_LAT         LAT address type
  712.             GSS_C_AF_HYLINK      NSC Hyperchannel address type
  713.             GSS_C_AF_APPLETALK   AppleTalk address type
  714.             GSS_C_AF_BSC         BISYNC 2780/3780 address type
  715.             GSS_C_AF_DSS         Distributed system services address type
  716.             GSS_C_AF_OSI         OSI TP4 address type
  717.  
  718.  
  719.  
  720.    Wray             Document Expiration: 31 September 1993        [Page 11]
  721.  
  722.  
  723.  
  724.  
  725.  
  726.  
  727.  
  728.    INTERNET-DRAFT      GSSAPI - Overview and C bindings          March 1993
  729.  
  730.  
  731.  
  732.             GSS_C_AF_X25         X25
  733.             GSS_C_AF_NULLADDR    No address specified
  734.  
  735.       Note that these name address families rather than specific addressing
  736.       formats.  For address families that contain several alternative
  737.       address forms, the initiator_address and acceptor_address fields must
  738.       contain sufficient information to determine which address form is
  739.       used.  When not otherwise specified, addresses should be specified in
  740.       network byte-order.
  741.  
  742.       Conceptually, the GSSAPI concatenates the initiator_addrtype,
  743.       initiator_address, acceptor_addrtype, acceptor_address and
  744.       application_data to form an octet string.  The mechanism signs this
  745.       octet string, and binds the signature to the context establishment
  746.       token emitted by gss_init_sec_context.  The same bindings are
  747.       presented by the context acceptor to gss_accept_sec_context, and a
  748.       signature is calculated in the same way.  The calculated signature is
  749.       compared with that found in the token, and if the signatures differ,
  750.       gss_accept_sec_context will return a GSS_S_BAD_BINDINGS error, and
  751.       the context will not be established.  Some mechanisms may include the
  752.       actual channel binding data in the token (rather than just a
  753.       signature); applications should therefore not use confidential data
  754.       as channel-binding components.  Individual mechanisms may impose
  755.       additional constraints on addresses and address types that may appear
  756.       in channel bindings.  For example, a mechanism may verify that the
  757.       initiator_address field of the channel bindings presented to
  758.       gss_init_sec_context contains the correct network address of the host
  759.       system.
  760.  
  761.    4.1.12. Optional parameters
  762.  
  763.       Various parameters are described as optional.  This means that they
  764.       follow a convention whereby a default value may be requested.  The
  765.       following conventions are used for omitted parameters.  These
  766.       conventions apply only to those parameters that are explicitly
  767.       documented as optional.
  768.  
  769.    4.1.12.1. gss_buffer_t types
  770.  
  771.       Specify GSS_C_NO_BUFFER as a value.  For an input parameter this
  772.       signifies that default behavior is requested, while for an output
  773.       parameter it indicates that the information that would be returned
  774.       via the parameter is not required by the application.
  775.  
  776.    4.1.12.2. Integer types (input)
  777.  
  778.       Individual parameter documentation lists values to be used to
  779.       indicate default actions.
  780.  
  781.  
  782.  
  783.  
  784.  
  785.  
  786.    Wray             Document Expiration: 31 September 1993        [Page 12]
  787.  
  788.  
  789.  
  790.  
  791.  
  792.  
  793.  
  794.    INTERNET-DRAFT      GSSAPI - Overview and C bindings          March 1993
  795.  
  796.  
  797.  
  798.    4.1.12.3. Integer types (output)
  799.  
  800.       Specify NULL as the value for the pointer.
  801.  
  802.    4.1.12.4. Pointer types
  803.  
  804.       Specify NULL as the value.
  805.  
  806.    4.1.12.5. Object IDs
  807.  
  808.       Specify GSS_C_NULL_OID as the value.
  809.  
  810.    4.1.12.6. Object ID Sets
  811.  
  812.       Specify GSS_C_NULL_OID_SET as the value.
  813.  
  814.    4.1.12.7. Credentials
  815.  
  816.       Specify GSS_C_NO_CREDENTIAL to use the default credential handle.
  817.  
  818.    4.1.12.8. Channel Bindings
  819.  
  820.       Specify GSS_C_NO_CHANNEL_BINDINGS to indicate that channel bindings
  821.       are not to be used.
  822.  
  823.  
  824.  
  825.    5. GSSAPI routine descriptions
  826.  
  827.    5.1. gss_acquire_cred
  828.  
  829.  
  830.       OM_uint32  gss_acquire_cred (
  831.                      OM_uint32 *     minor_status,
  832.                      gss_name_t      desired_name,
  833.                      OM_uint32       time_req,
  834.                      gss_OID_set     desired_mechs,
  835.                      int             cred_usage,
  836.                      gss_cred_id_t * output_cred_handle,
  837.                      gss_OID_set *   actual_mechs,
  838.                      OM_int32 *      time_rec)
  839.    Purpose:
  840.  
  841.       Allows an application to acquire a handle for a pre-existing
  842.       credential by name.  GSSAPI implementations must impose a local
  843.       access-control policy on callers of this routine to prevent
  844.       unauthorized callers from acquiring credentials to which they are not
  845.       entitled.  This routine is not intended to provide a ``login to the
  846.       network'' function, as such a function would result in the creation
  847.       of new credentials rather than merely acquiring a handle to existing
  848.       credentials.  Such functions, if required, should be defined in
  849.  
  850.  
  851.  
  852.    Wray             Document Expiration: 31 September 1993        [Page 13]
  853.  
  854.  
  855.  
  856.  
  857.  
  858.  
  859.  
  860.    INTERNET-DRAFT      GSSAPI - Overview and C bindings          March 1993
  861.  
  862.  
  863.  
  864.       implementation-specific extensions to the API.
  865.  
  866.       If credential acquisition is time-consuming for a mechanism, the
  867.       mechanism may chooses to delay the actual acquisition until the
  868.       credential is required (e.g. by gss_init_sec_context or
  869.       gss_accept_sec_context).  Such mechanism-specific implementation
  870.       decisions should be invisible to the calling application; thus a call
  871.       of gss_inquire_cred immediately following the call of
  872.       gss_acquire_cred must return valid credential data, and may therefore
  873.       incur the overhead of a deferred credential acquisition.
  874.  
  875.    Parameters:
  876.  
  877.       desired_name      gss_name_t, read
  878.                         Name of principal whose credential
  879.                         should be acquired
  880.  
  881.       time_req          integer, read
  882.                         number of seconds that credentials
  883.                         should remain valid
  884.  
  885.       desired_mechs     Set of Object IDs, read
  886.                         set of underlying security mechanisms that
  887.                         may be used.  GSS_C_NULL_OID_SET may be used
  888.                         to obtain an implementation-specific default.
  889.  
  890.       cred_usage        integer, read
  891.                         GSS_C_BOTH - Credentials may be used
  892.                                      either to initiate or accept
  893.                                      security contexts.
  894.                         GSS_C_INITIATE - Credentials will only be
  895.                                          used to initiate security
  896.                                          contexts.
  897.                         GSS_C_ACCEPT - Credentials will only be used to
  898.                                        accept security contexts.
  899.  
  900.       output_cred_handle   gss_cred_id_t, modify
  901.                            The returned credential handle.
  902.  
  903.       actual_mechs      Set of Object IDs, modify, optional
  904.                         The set of mechanisms for which the
  905.                         credential is valid.  Specify NULL
  906.                         if not required.
  907.  
  908.       time_rec          Integer, modify, optional
  909.                         Actual number of seconds for which the
  910.                         returned credentials will remain valid.  If the
  911.                         implementation does not support expiration of
  912.                         credentials, the value GSS_C_INDEFINITE will
  913.                         be returned. Specify NULL if not required
  914.  
  915.  
  916.  
  917.  
  918.    Wray             Document Expiration: 31 September 1993        [Page 14]
  919.  
  920.  
  921.  
  922.  
  923.  
  924.  
  925.  
  926.    INTERNET-DRAFT      GSSAPI - Overview and C bindings          March 1993
  927.  
  928.  
  929.  
  930.       minor_status      Integer, modify
  931.                         Mechanism specific status code.
  932.  
  933.    Function value:
  934.  
  935.       GSS status code:
  936.  
  937.       GSS_S_COMPLETE    Successful completion
  938.  
  939.       GSS_S_BAD_MECH    Unavailable mechanism requested
  940.  
  941.       GSS_S_BAD_NAMETYPE Type contained within desired_name parameter is
  942.                         not supported
  943.  
  944.       GSS_S_BAD_NAME    Value supplied for desired_name parameter is ill-
  945.                         formed.
  946.  
  947.       GSS_S_FAILURE     Unspecified failure.  The minor_status parameter
  948.                         contains more detailed information
  949.  
  950.  
  951.    5.2. gss_release_cred
  952.  
  953.       OM_uint32  gss_release_cred (
  954.                      OM_uint32 *     minor_status,
  955.                      gss_cred_id_t * cred_handle)
  956.  
  957.  
  958.  
  959.    Purpose:
  960.  
  961.       Informs GSSAPI that the specified credential handle is no longer
  962.       required by the process.  When all processes have released a
  963.       credential, it will be deleted.
  964.  
  965.    Parameters:
  966.  
  967.       cred_handle       gss_cred_id_t, modify, optional
  968.                         buffer containing opaque credential
  969.                         handle.  If  GSS_C_NO_CREDENTIAL  is supplied,
  970.                         the default credential will be released
  971.  
  972.       minor_status      integer, modify
  973.                         Mechanism specific status code.
  974.  
  975.    Function value:
  976.  
  977.       GSS status code:
  978.  
  979.       GSS_S_COMPLETE    Successful completion
  980.  
  981.  
  982.  
  983.  
  984.    Wray             Document Expiration: 31 September 1993        [Page 15]
  985.  
  986.  
  987.  
  988.  
  989.  
  990.  
  991.  
  992.    INTERNET-DRAFT      GSSAPI - Overview and C bindings          March 1993
  993.  
  994.  
  995.  
  996.       GSS_S_NO_CRED     Credentials could not be accessed.
  997.  
  998.  
  999.    5.3. gss_init_sec_context
  1000.  
  1001.       OM_uint32  gss_init_sec_context (
  1002.                      OM_uint32 *     minor_status,
  1003.                      gss_cred_id_t   claimant_cred_handle,
  1004.                      gss_ctx_id_t *  context_handle,
  1005.                      gss_name_t      target_name,
  1006.                      gss_OID         mech_type,
  1007.                      int             req_flags,
  1008.                      int             time_req,
  1009.                      gss_channel_bindings_t
  1010.                                      input_chan_bindings,
  1011.                      gss_buffer_t    input_token
  1012.                      gss_OID *       actual_mech_type,
  1013.                      gss_buffer_t    output_token,
  1014.                      int *           ret_flags,
  1015.                      OM_uint32 *     time_rec )
  1016.  
  1017.    Purpose:
  1018.  
  1019.       Initiates the establishment of a security context between the
  1020.       application and a remote peer.  Initially, the input_token parameter
  1021.       should be specified as GSS_C_NO_BUFFER.  The routine may return a
  1022.       output_token which should be transferred to the peer application,
  1023.       where the peer application will present it to gss_accept_sec_context.
  1024.       If no token need be sent, gss_init_sec_context will indicate this by
  1025.       setting the length field of the output_token argument to zero.  To
  1026.       complete the context establishment, one or more reply tokens may be
  1027.       required from the peer application; if so, gss_init_sec_context will
  1028.       return a status indicating GSS_S_CONTINUE_NEEDED in which case it
  1029.       should be called again when the reply token is received from the peer
  1030.       application, passing the token to gss_init_sec_context via the
  1031.       input_token parameters.
  1032.  
  1033.       The values returned via the ret_flags and time_rec parameters are not
  1034.       defined unless the routine returns GSS_S_COMPLETE.
  1035.  
  1036.  
  1037.    Parameters:
  1038.  
  1039.       claimant_cred_handle  gss_cred_id_t, read, optional
  1040.                             handle for credentials claimed.  Supply
  1041.                             GSS_C_NO_CREDENTIAL to use default
  1042.                             credentials.
  1043.  
  1044.       context_handle    gss_ctx_id_t, read/modify
  1045.                         context handle for new context.  Supply
  1046.                         GSS_C_NO_CONTEXT for first call; use value
  1047.  
  1048.  
  1049.  
  1050.    Wray             Document Expiration: 31 September 1993        [Page 16]
  1051.  
  1052.  
  1053.  
  1054.  
  1055.  
  1056.  
  1057.  
  1058.    INTERNET-DRAFT      GSSAPI - Overview and C bindings          March 1993
  1059.  
  1060.  
  1061.  
  1062.                         returned by first call in continuation calls.
  1063.  
  1064.       target_name       gss_name_t, read
  1065.                         Name of target
  1066.  
  1067.       mech_type         OID, read, optional
  1068.                         Object ID of desired mechanism. Supply
  1069.                         GSS_C_NULL_OID to obtain an implementation
  1070.                         specific default
  1071.  
  1072.       req_flags         bit-mask, read
  1073.                         Contains four independent flags, each of
  1074.                         which requests that the context support a
  1075.                         specific service option.  Symbolic
  1076.                         names are provided for each flag, and the
  1077.                         symbolic names corresponding to the required
  1078.                         flags should be logically-ORed
  1079.                         together to form the bit-mask value.  The
  1080.                         flags are:
  1081.  
  1082.                         GSS_C_DELEG_FLAG
  1083.                               True - Delegate credentials to remote peer
  1084.                               False - Don't delegate
  1085.                         GSS_C_MUTUAL_FLAG
  1086.                               True - Request that remote peer
  1087.                                      authenticate itself
  1088.                               False - Authenticate self to remote peer
  1089.                                       only
  1090.                         GSS_C_REPLAY_FLAG
  1091.                               True - Enable replay detection for signed
  1092.                                      or sealed messages
  1093.                               False - Don't attempt to detect
  1094.                                       replayed messages
  1095.                         GSS_C_SEQUENCE_FLAG
  1096.                               True - Enable detection of out-of-sequence
  1097.                                      signed or sealed messages
  1098.                               False - Don't attempt to detect
  1099.                                       out-of-sequence messages
  1100.  
  1101.       time_req          integer, read
  1102.                         Desired number of seconds for which context
  1103.                         should remain valid.  Supply 0 to request a
  1104.                         default validity period.
  1105.  
  1106.       input_chan_bindings     channel bindings, read
  1107.                               Application-specified bindings.  Allows
  1108.                               application to securely bind channel
  1109.                               identification information to the security
  1110.                               context.
  1111.  
  1112.       input_token       buffer, opaque, read, optional (see text)
  1113.  
  1114.  
  1115.  
  1116.    Wray             Document Expiration: 31 September 1993        [Page 17]
  1117.  
  1118.  
  1119.  
  1120.  
  1121.  
  1122.  
  1123.  
  1124.    INTERNET-DRAFT      GSSAPI - Overview and C bindings          March 1993
  1125.  
  1126.  
  1127.  
  1128.                         Token received from peer application.
  1129.                         Supply GSS_C_NO_BUFFER on initial call.
  1130.  
  1131.       actual_mech_type  OID, modify
  1132.                         actual mechanism used.
  1133.  
  1134.       output_token      buffer, opaque, modify
  1135.                         token to be sent to peer application.  If
  1136.                         the length field of the returned buffer is
  1137.                         zero, no token need be sent to the peer
  1138.                         application.
  1139.  
  1140.       ret_flags         bit-mask, modify
  1141.                         Contains six independent flags, each of which
  1142.                         indicates that the context supports a specific
  1143.                         service option.  Symbolic names are provided
  1144.                         for each flag, and the symbolic names
  1145.                         corresponding to the required flags should be
  1146.                         logically-ANDed with the ret_flags value to test
  1147.                         whether a given option is supported by the
  1148.                         context.  The flags are:
  1149.  
  1150.                         GSS_C_DELEG_FLAG
  1151.                               True - Credentials were delegated to
  1152.                                      the remote peer
  1153.                               False - No credentials were delegated
  1154.                         GSS_C_MUTUAL_FLAG
  1155.                               True - Remote peer has been asked to
  1156.                                      authenticated itself
  1157.                               False - Remote peer has not been asked to
  1158.                                       authenticate itself
  1159.                         GSS_C_REPLAY_FLAG
  1160.                               True - replay of signed or sealed messages
  1161.                                      will be detected
  1162.                               False - replayed messages will not be
  1163.                                       detected
  1164.                         GSS_C_SEQUENCE_FLAG
  1165.                               True - out-of-sequence signed or sealed
  1166.                                      messages will be detected
  1167.                               False - out-of-sequence messages will not
  1168.                                       be detected
  1169.                         GSS_C_CONF_FLAG
  1170.                               True - Confidentiality service may be
  1171.                                      invoked by calling seal routine
  1172.                               False - No confidentiality service (via
  1173.                                       seal) available. seal will provide
  1174.                                       message encapsulation, data-origin
  1175.                                       authentication and integrity
  1176.                                       services only.
  1177.                         GSS_C_INTEG_FLAG
  1178.                               True - Integrity service may be invoked by
  1179.  
  1180.  
  1181.  
  1182.    Wray             Document Expiration: 31 September 1993        [Page 18]
  1183.  
  1184.  
  1185.  
  1186.  
  1187.  
  1188.  
  1189.  
  1190.    INTERNET-DRAFT      GSSAPI - Overview and C bindings          March 1993
  1191.  
  1192.  
  1193.  
  1194.                                      calling either gss_sign or gss_seal
  1195.                                      routines.
  1196.                               False - Per-message integrity service
  1197.                                       unavailable.
  1198.  
  1199.       time_rec          integer, modify, optional
  1200.                         number of seconds for which the context
  1201.                         will remain valid. If the implementation does
  1202.                         not support credential expiration, the value
  1203.                         GSS_C_INDEFINITE will be returned.  Specify
  1204.                         NULL if not required.
  1205.  
  1206.       minor_status      integer,  modify
  1207.                         Mechanism specific status code.
  1208.  
  1209.    Function value:
  1210.  
  1211.       GSS status code:
  1212.  
  1213.       GSS_S_COMPLETE    Successful completion
  1214.  
  1215.       GSS_S_CONTINUE_NEEDED Indicates that a token from the peer
  1216.                         application is required to complete thecontext, and
  1217.                         that gss_init_sec_context must be called again with
  1218.                         that token.
  1219.  
  1220.       GSS_S_DEFECTIVE_TOKEN Indicates that consistency checks performed on
  1221.                         the input_token failed
  1222.  
  1223.       GSS_S_DEFECTIVE_CREDENTIAL Indicates that consistency checks
  1224.                         performed on the credential failed.
  1225.  
  1226.       GSS_S_NO_CRED     The supplied credentials were not valid for context
  1227.                         initiation, or the credential handle did not
  1228.                         reference any credentials.
  1229.  
  1230.       GSS_S_CREDENTIALS_EXPIRED The referenced credentials have expired
  1231.  
  1232.       GSS_S_BAD_BINDINGS The input_token contains different channel
  1233.                         bindings to those specified via the
  1234.                         input_chan_bindings parameter
  1235.  
  1236.       GSS_S_BAD_SIG     The input_token contains an invalid signature, or a
  1237.                         signature that could not be verified
  1238.  
  1239.       GSS_S_OLD_TOKEN   The input_token was too old.  This is a fatal error
  1240.                         during context establishment
  1241.  
  1242.       GSS_S_DUPLICATE_TOKEN The input_token is valid, but is a duplicate of
  1243.                         a token already processed.  This is a fatal error
  1244.                         during context establishment.
  1245.  
  1246.  
  1247.  
  1248.    Wray             Document Expiration: 31 September 1993        [Page 19]
  1249.  
  1250.  
  1251.  
  1252.  
  1253.  
  1254.  
  1255.  
  1256.    INTERNET-DRAFT      GSSAPI - Overview and C bindings          March 1993
  1257.  
  1258.  
  1259.  
  1260.       GSS_S_NO_CONTEXT  Indicates that the supplied context handle did not
  1261.                         refer to a valid context
  1262.  
  1263.       GSS_S_BAD_NAMETYPE The provided target_name parameter contained an
  1264.                         invalid or unsupported type of name
  1265.  
  1266.       GSS_S_BAD_NAME    The provided target_name parameter was ill-formed.
  1267.  
  1268.       GSS_S_FAILURE     Failure.  See minor_status for more information
  1269.  
  1270.  
  1271.    5.4. gss_accept_sec_context
  1272.  
  1273.       OM_uint32  gss_accept_sec_context (
  1274.                      OM_uint32 *     minor_status,
  1275.                      gss_ctx_id_t *  context_handle,
  1276.                      gss_cred_id_t   verifier_cred_handle,
  1277.                      gss_buffer_t    input_token_buffer
  1278.                      gss_channel_bindings_t
  1279.                                      input_chan_bindings,
  1280.                      gss_name_t *    src_name,
  1281.                      gss_OID *       mech_type,
  1282.                      gss_buffer_t    output_token,
  1283.                      int *           ret_flags,
  1284.                      OM_uint32 *     time_rec,
  1285.                      gss_cred_id_t * delegated_cred_handle)
  1286.  
  1287.    Purpose:
  1288.  
  1289.       Allows a remotely initiated security context between the application
  1290.       and a remote peer to be established.  The routine may return a
  1291.       output_token which should be transferred to the peer application,
  1292.       where the peer application will present it to gss_init_sec_context.
  1293.       If no token need be sent, gss_accept_sec_context will indicate this
  1294.       by setting the length field of the output_token argument to zero.  To
  1295.       complete the context establishment, one or more reply tokens may be
  1296.       required from the peer application; if so, gss_accept_sec_context
  1297.       will return a status flag of GSS_S_CONTINUE_NEEDED, in which case it
  1298.       should be called again when the reply token is received from the peer
  1299.       application, passing the token to gss_accept_sec_context via the
  1300.       input_token parameters.
  1301.  
  1302.       The values returned via the src_name, ret_flags, time_rec, and
  1303.       delegated_cred_handle parameters are not defined unless the routine
  1304.       returns GSS_S_COMPLETE.
  1305.  
  1306.    Parameters:
  1307.  
  1308.       context_handle    gss_ctx_id_t, read/modify
  1309.                         context handle for new context.  Supply
  1310.                         GSS_C_NO_CONTEXT for first call; use value
  1311.  
  1312.  
  1313.  
  1314.    Wray             Document Expiration: 31 September 1993        [Page 20]
  1315.  
  1316.  
  1317.  
  1318.  
  1319.  
  1320.  
  1321.  
  1322.    INTERNET-DRAFT      GSSAPI - Overview and C bindings          March 1993
  1323.  
  1324.  
  1325.  
  1326.                         returned in subsequent calls.
  1327.  
  1328.       verifier_cred_handle    gss_cred_id_t, read, optional
  1329.                               Credential handle claimed by context
  1330.       acceptor.
  1331.                               Specify GSS_C_NO_CREDENTIAL to use default
  1332.                               credentials.  If GSS_C_NO_CREDENTIAL is
  1333.                               specified, but the caller has no default
  1334.                               credentials established, an
  1335.                               implementation-defined default credential
  1336.                               may be used.
  1337.  
  1338.       input_token_buffer      buffer, opaque, read
  1339.                               token obtained from remote application
  1340.  
  1341.       input_chan_bindings     channel bindings, read
  1342.                               Application-specified bindings.  Allows
  1343.                               application to securely bind channel
  1344.                               identification information to the security
  1345.                               context.
  1346.  
  1347.       src_name          gss_name_t, modify, optional
  1348.                         Authenticated name of context initiator.
  1349.                         After use, this name should be deallocated by
  1350.                         passing it to gss_release_name.  If not required,
  1351.                         specify NULL.
  1352.  
  1353.       mech_type         Object ID, modify
  1354.                         Security mechanism used.  The returned
  1355.                         OID value will be a pointer into static
  1356.                         storage, and should be treated as read-only
  1357.                         by the caller.
  1358.  
  1359.       output_token      buffer, opaque, modify
  1360.                         Token to be passed to peer application. If the
  1361.                         length field of the returned token buffer is 0,
  1362.                         then no token need be passed to the peer
  1363.                         application.
  1364.  
  1365.       ret_flags         bit-mask, modify
  1366.                         Contains six independent flags, each of
  1367.                         which indicates that the context supports a
  1368.                         specific service option.  Symbolic names are
  1369.                         provided for each flag, and the symbolic names
  1370.                         corresponding to the required flags
  1371.                         should be logically-ANDed with the ret_flags
  1372.                         value to test whether a given option is
  1373.                         supported by the context.  The flags are:
  1374.                         GSS_C_DELEG_FLAG
  1375.                               True - Delegated credentials are available
  1376.                                      via the delegated_cred_handle
  1377.  
  1378.  
  1379.  
  1380.    Wray             Document Expiration: 31 September 1993        [Page 21]
  1381.  
  1382.  
  1383.  
  1384.  
  1385.  
  1386.  
  1387.  
  1388.    INTERNET-DRAFT      GSSAPI - Overview and C bindings          March 1993
  1389.  
  1390.  
  1391.  
  1392.                                      parameter
  1393.                               False - No credentials were delegated
  1394.                         GSS_C_MUTUAL_FLAG
  1395.                               True - Remote peer asked for mutual
  1396.                                      authentication
  1397.                               False - Remote peer did not ask for mutual
  1398.                                       authentication
  1399.                         GSS_C_REPLAY_FLAG
  1400.                               True - replay of signed or sealed messages
  1401.                                      will be detected
  1402.                               False - replayed messages will not be
  1403.                                       detected
  1404.                         GSS_C_SEQUENCE_FLAG
  1405.                               True - out-of-sequence signed or sealed
  1406.                                      messages will be detected
  1407.                               False - out-of-sequence messages will not
  1408.                                       be detected
  1409.                         GSS_C_CONF_FLAG
  1410.                               True - Confidentiality service may be invoked
  1411.                                      by calling seal routine
  1412.                               False - No confidentiality service (via
  1413.                                       seal) available. seal will provide
  1414.                                       message encapsulation, data-origin
  1415.                                       authentication and integrity services
  1416.                                       only.
  1417.                         GSS_C_INTEG_FLAG
  1418.                               True - Integrity service may be invoked by
  1419.                                      calling either gss_sign or gss_seal
  1420.                                      routines.
  1421.                               False - Per-message integrity service
  1422.                                       unavailable.
  1423.  
  1424.       time_rec          integer, modify, optional
  1425.                         number of seconds for which the context
  1426.                         will remain valid. Specify NULL if not required.
  1427.  
  1428.       delegated_cred_handle
  1429.                         gss_cred_id_t, modify
  1430.                         credential handle for credentials received from
  1431.                         context initiator.  Only valid if deleg_flag in
  1432.                         ret_flags is true.
  1433.  
  1434.       minor_status      integer, modify
  1435.                         Mechanism specific status code.
  1436.  
  1437.  
  1438.    Function value:
  1439.  
  1440.       GSS status code:
  1441.  
  1442.  
  1443.  
  1444.  
  1445.  
  1446.    Wray             Document Expiration: 31 September 1993        [Page 22]
  1447.  
  1448.  
  1449.  
  1450.  
  1451.  
  1452.  
  1453.  
  1454.    INTERNET-DRAFT      GSSAPI - Overview and C bindings          March 1993
  1455.  
  1456.  
  1457.  
  1458.       GSS_S_COMPLETE    Successful completion
  1459.  
  1460.       GSS_S_CONTINUE_NEEDED Indicates that a token from the peer
  1461.                         application is required to complete the context,
  1462.                         and that gss_accept_sec_context must be called
  1463.                         again with that token.
  1464.  
  1465.       GSS_S_DEFECTIVE_TOKEN Indicates that consistency checks performed on
  1466.                         the input_token failed.
  1467.  
  1468.       GSS_S_DEFECTIVE_CREDENTIAL Indicates that consistency checks
  1469.                         performed on the credential failed.
  1470.  
  1471.       GSS_S_NO_CRED     The supplied credentials were not valid for context
  1472.                         acceptance, or the credential handle did not
  1473.                         reference any credentials.
  1474.  
  1475.       GSS_S_CREDENTIALS_EXPIRED The referenced credentials have expired.
  1476.  
  1477.       GSS_S_BAD_BINDINGS The input_token contains different channel
  1478.                         bindings to those specified via the
  1479.                         input_chan_bindings parameter.
  1480.  
  1481.       GSS_S_NO_CONTEXT  Indicates that the supplied context handle did not
  1482.                         refer to a valid context.
  1483.  
  1484.       GSS_S_BAD_SIG     The input_token contains an invalid signature.
  1485.  
  1486.       GSS_S_OLD_TOKEN   The input_token was too old.  This is a fatal error
  1487.                         during context establishment.
  1488.  
  1489.       GSS_S_DUPLICATE_TOKEN The input_token is valid, but is a duplicate of
  1490.                         a token already processed.  This is a fatal error
  1491.                         during context establishment.
  1492.  
  1493.       GSS_S_FAILURE     Failure.  See minor_status for more information.
  1494.  
  1495.  
  1496.    5.5. gss_process_context_token
  1497.  
  1498.       OM_uint32  gss_process_context_token (
  1499.                      OM_uint32 *     minor_status,
  1500.                      gss_ctx_id_t    context_handle,
  1501.                      gss_buffer_t    token_buffer)
  1502.  
  1503.    Purpose:
  1504.  
  1505.       Provides a way to pass a token to the security service.  Usually,
  1506.       tokens are associated either with context establishment (when they
  1507.       would be passed to gss_init_sec_context or gss_accept_sec_context) or
  1508.       with per-message security service (when they would be passed to
  1509.  
  1510.  
  1511.  
  1512.    Wray             Document Expiration: 31 September 1993        [Page 23]
  1513.  
  1514.  
  1515.  
  1516.  
  1517.  
  1518.  
  1519.  
  1520.    INTERNET-DRAFT      GSSAPI - Overview and C bindings          March 1993
  1521.  
  1522.  
  1523.  
  1524.       gss_verify or  gss_unseal).  Occasionally, tokens may be received at
  1525.       other times, and gss_process_context_token allows such tokens to be
  1526.       passed to the underlying security service for processing.  At
  1527.       present, such additional tokens may only be generated by
  1528.       gss_delete_sec_context.  GSSAPI implementation may use this service
  1529.       to implement deletion of the security context.
  1530.  
  1531.    Parameters:
  1532.  
  1533.       context_handle    gss_ctx_id_t, read
  1534.                         context handle of context on which token is to
  1535.                         be processed
  1536.  
  1537.       token_buffer      buffer, opaque, read
  1538.                         pointer to first byte of token to process
  1539.  
  1540.       minor_status      integer, modify
  1541.                         Implementation specific status code.
  1542.  
  1543.    Function value:
  1544.  
  1545.       GSS status code:
  1546.  
  1547.       GSS_S_COMPLETE    Successful completion
  1548.  
  1549.       GSS_S_DEFECTIVE_TOKEN Indicates that consistency checks performed on
  1550.                         the token failed
  1551.  
  1552.       GSS_S_FAILURE     Failure.  See minor_status for more information
  1553.  
  1554.       GSS_S_NO_CONTEXT  The context_handle did not refer to a valid context
  1555.  
  1556.  
  1557.    5.6. gss_delete_sec_context
  1558.  
  1559.       OM_uint32  gss_delete_sec_context (
  1560.                      OM_uint32 *     minor_status,
  1561.                      gss_ctx_id_t *  context_handle,
  1562.                      gss_buffer_t    output_token)
  1563.  
  1564.    Purpose:
  1565.  
  1566.       Delete a security context.  gss_delete_sec_context will delete the
  1567.       local data structures associated with the specified security context,
  1568.       and generate an output_token, which when passed to the peer
  1569.       gss_process_context_token will instruct it to do likewise.  No
  1570.       further security services may be obtained using the context specified
  1571.       by context_handle.
  1572.  
  1573.    Parameters:
  1574.  
  1575.  
  1576.  
  1577.  
  1578.    Wray             Document Expiration: 31 September 1993        [Page 24]
  1579.  
  1580.  
  1581.  
  1582.  
  1583.  
  1584.  
  1585.  
  1586.    INTERNET-DRAFT      GSSAPI - Overview and C bindings          March 1993
  1587.  
  1588.  
  1589.  
  1590.       minor_status      integer, modify
  1591.                         Mechanism specific status code.
  1592.  
  1593.       context_handle    gss_ctx_id_t, modify
  1594.                         context handle identifying context to delete.
  1595.  
  1596.       output_token      buffer, opaque, modify
  1597.                         token to be sent to remote application to
  1598.                         instruct it to also delete the context
  1599.  
  1600.    Function value:
  1601.  
  1602.       GSS status code:
  1603.  
  1604.       GSS_S_COMPLETE    Successful completion
  1605.  
  1606.       GSS_S_FAILURE     Failure, see minor_status for more information
  1607.  
  1608.       GSS_S_NO_CONTEXT  No valid context was supplied
  1609.  
  1610.  
  1611.    5.7. gss_context_time
  1612.  
  1613.       OM_uint32  gss_context_time (
  1614.                      OM_uint32 *     minor_status,
  1615.                      gss_ctx_id_t    context_handle,
  1616.                      OM_uint32 *     time_rec)
  1617.  
  1618.    Purpose:
  1619.  
  1620.       Determines the number of seconds for which the specified context will
  1621.       remain valid.
  1622.  
  1623.    Parameters:
  1624.  
  1625.       minor_status      integer, modify
  1626.                         Implementation specific status code.
  1627.  
  1628.       context_handle    gss_ctx_id_t, read
  1629.                         Identifies the context to be interrogated.
  1630.  
  1631.       time_rec          integer, modify
  1632.                         Number of seconds that the context will remain
  1633.                         valid.  If the context has already expired,
  1634.                         zero will be returned.
  1635.  
  1636.    Function value:
  1637.  
  1638.       GSS status code:
  1639.  
  1640.  
  1641.  
  1642.  
  1643.  
  1644.    Wray             Document Expiration: 31 September 1993        [Page 25]
  1645.  
  1646.  
  1647.  
  1648.  
  1649.  
  1650.  
  1651.  
  1652.    INTERNET-DRAFT      GSSAPI - Overview and C bindings          March 1993
  1653.  
  1654.  
  1655.  
  1656.       GSS_S_COMPLETE    Successful completion
  1657.  
  1658.       GSS_S_CONTEXT_EXPIRED The context has already expired
  1659.  
  1660.       GSS_S_CREDENTIALS_EXPIRED The context is recognized, but associated
  1661.                         credentials have expired
  1662.  
  1663.       GSS_S_NO_CONTEXT  The context_handle parameter did not identify a
  1664.                         valid context
  1665.  
  1666.  
  1667.    5.8. gss_sign
  1668.  
  1669.       OM_uint32  gss_sign (
  1670.                      OM_uint32 *     minor_status,
  1671.                      gss_ctx_id_t    context_handle,
  1672.                      int             qop_req,
  1673.                      gss_buffer_t    message_buffer,
  1674.                      gss_buffer_t    msg_token)
  1675.  
  1676.    Purpose:
  1677.  
  1678.       Generates a cryptographic signature for the supplied message, and
  1679.       places the signature in a token for transfer to the peer application.
  1680.       The qop_req parameter allows a choice between several cryptographic
  1681.       algorithms, if supported by the chosen mechanism.
  1682.  
  1683.    Parameters:
  1684.  
  1685.       minor_status      integer, modify
  1686.                         Implementation specific status code.
  1687.  
  1688.       context_handle    gss_ctx_id_t, read
  1689.                         identifies the context on which the message
  1690.                         will be sent
  1691.  
  1692.       qop_req           integer, read, optional
  1693.                         Specifies requested quality of protection.
  1694.                         Callers are encouraged, on portability grounds,
  1695.                         to accept the default quality of protection
  1696.                         offered by the chosen mechanism, which may be
  1697.                         requested by specifying GSS_C_QOP_DEFAULT for
  1698.                         this parameter.  If an unsupported protection
  1699.                         strength is requested, gss_sign will return a
  1700.                         major_status of GSS_S_FAILURE.
  1701.  
  1702.       message_buffer    buffer, opaque, read
  1703.                         message to be signed
  1704.  
  1705.       msg_token         buffer, opaque, modify
  1706.                         buffer to receive token
  1707.  
  1708.  
  1709.  
  1710.    Wray             Document Expiration: 31 September 1993        [Page 26]
  1711.  
  1712.  
  1713.  
  1714.  
  1715.  
  1716.  
  1717.  
  1718.    INTERNET-DRAFT      GSSAPI - Overview and C bindings          March 1993
  1719.  
  1720.  
  1721.  
  1722.    Function value:
  1723.  
  1724.       GSS status code:
  1725.  
  1726.       GSS_S_COMPLETE    Successful completion
  1727.  
  1728.       GSS_S_CONTEXT_EXPIRED The context has already expired
  1729.  
  1730.       GSS_S_CREDENTIALS_EXPIRED The context is recognized, but associated
  1731.                         credentials have expired
  1732.  
  1733.       GSS_S_NO_CONTEXT  The context_handle parameter did not identify a
  1734.                         valid context
  1735.  
  1736.       GSS_S_FAILURE     Failure. See minor_status for more information.
  1737.  
  1738.  
  1739.    5.9. gss_verify
  1740.  
  1741.       OM_uint32  gss_verify (
  1742.                      OM_uint32 *     minor_status,
  1743.                      gss_ctx_id_t    context_handle,
  1744.                      gss_buffer_t    message_buffer,
  1745.                      gss_buffer_t    token_buffer,
  1746.                      int *           qop_state)
  1747.  
  1748.    Purpose:
  1749.  
  1750.       Verifies that a cryptographic signature, contained in the token
  1751.       parameter, fits the supplied message.  The qop_state parameter allows
  1752.       a message recipient to determine the strength of protection that was
  1753.       applied to the message.
  1754.  
  1755.    Parameters:
  1756.  
  1757.       minor_status      integer, modify
  1758.                         Mechanism specific status code.
  1759.  
  1760.       context_handle    gss_ctx_id_t, read
  1761.                         identifies the context on which the message
  1762.                         arrived
  1763.  
  1764.       message_buffer    buffer, opaque, read
  1765.                         message to be verified
  1766.  
  1767.       token_buffer      buffer, opaque, read
  1768.                         token associated with message
  1769.  
  1770.       qop_state         integer, modify
  1771.                         quality of protection gained from signature
  1772.  
  1773.  
  1774.  
  1775.  
  1776.    Wray             Document Expiration: 31 September 1993        [Page 27]
  1777.  
  1778.  
  1779.  
  1780.  
  1781.  
  1782.  
  1783.  
  1784.    INTERNET-DRAFT      GSSAPI - Overview and C bindings          March 1993
  1785.  
  1786.  
  1787.  
  1788.    Function value:
  1789.  
  1790.       GSS status code:
  1791.  
  1792.       GSS_S_COMPLETE    Successful completion
  1793.  
  1794.       GSS_S_DEFECTIVE_TOKEN The token failed consistency checks
  1795.  
  1796.       GSS_S_BAD_SIG     The signature was incorrect
  1797.  
  1798.       GSS_S_DUPLICATE_TOKEN The token was valid, and contained a correct
  1799.                         signature for the message, but it had already been
  1800.                         processed
  1801.  
  1802.       GSS_S_OLD_TOKEN   The token was valid, and contained a correct
  1803.                         signature for the message, but it is too old
  1804.  
  1805.       GSS_S_UNSEQ_TOKEN The token was valid, and contained a correct
  1806.                         signature for the message, but has been verified
  1807.                         out of sequence; an earlier token has been signed
  1808.                         or sealed by the remote application, but not yet
  1809.                         been processed locally.
  1810.  
  1811.       GSS_S_CONTEXT_EXPIRED The context has already expired
  1812.  
  1813.       GSS_S_CREDENTIALS_EXPIRED The context is recognized, but associated
  1814.                         credentials have expired
  1815.  
  1816.       GSS_S_NO_CONTEXT  The context_handle parameter did not identify a
  1817.                         valid context
  1818.  
  1819.       GSS_S_FAILURE     Failure.  See minor_status for more information.
  1820.  
  1821.  
  1822.    5.10. gss_seal
  1823.  
  1824.       OM_uint32  gss_seal (
  1825.                      OM_uint32 *     minor_status,
  1826.                      gss_ctx_id_t    context_handle,
  1827.                      int             conf_req_flag,
  1828.                      int             qop_req
  1829.                      gss_buffer_t    input_message_buffer,
  1830.                      int *           conf_state,
  1831.                      gss_buffer_t    output_message_buffer)
  1832.  
  1833.    Purpose:
  1834.  
  1835.       Cryptographically signs and optionally encrypts the specified
  1836.       input_message.  The output_message contains both the signature and
  1837.       the message.  The qop_req parameter allows a choice between several
  1838.       cryptographic algorithms, if supported by the chosen mechanism.
  1839.  
  1840.  
  1841.  
  1842.    Wray             Document Expiration: 31 September 1993        [Page 28]
  1843.  
  1844.  
  1845.  
  1846.  
  1847.  
  1848.  
  1849.  
  1850.    INTERNET-DRAFT      GSSAPI - Overview and C bindings          March 1993
  1851.  
  1852.  
  1853.  
  1854.    Parameters:
  1855.  
  1856.       minor_status      integer, modify
  1857.                         Mechanism specific status code.
  1858.  
  1859.       context_handle    gss_ctx_id_t, read
  1860.                         identifies the context on which the message
  1861.                         will be sent
  1862.  
  1863.       conf_req_flag     boolean, read
  1864.                         True - Both confidentiality and integrity
  1865.                                services are requested
  1866.                         False - Only integrity service is requested
  1867.  
  1868.       qop_req           integer, read, optional
  1869.                         Specifies required quality of protection.  A
  1870.                         mechanism-specific default may be requested by
  1871.                         setting qop_req to GSS_C_QOP_DEFAULT.  If an
  1872.                         unsupported protection strength is requested,
  1873.                         gss_seal will return a major_status of
  1874.                         GSS_S_FAILURE.
  1875.  
  1876.       input_message_buffer   buffer, opaque, read
  1877.                              message to be sealed
  1878.  
  1879.       conf_state        boolean, modify
  1880.                         True - Confidentiality, data origin
  1881.                                authentication and integrity services
  1882.                                have been applied
  1883.                         False - Integrity and data origin services only
  1884.                                 has been applied.
  1885.  
  1886.       output_message_buffer  buffer, opaque, modify
  1887.                              buffer to receive sealed message
  1888.  
  1889.    Function value:
  1890.  
  1891.       GSS status code:
  1892.  
  1893.       GSS_S_COMPLETE    Successful completion
  1894.  
  1895.       GSS_S_CONTEXT_EXPIRED The context has already expired
  1896.  
  1897.       GSS_S_CREDENTIALS_EXPIRED The context is recognized, but associated
  1898.                         credentials have expired
  1899.  
  1900.       GSS_S_NO_CONTEXT  The context_handle parameter did not identify a
  1901.                         valid context
  1902.  
  1903.       GSS_S_FAILURE     Failure.  See minor_status for more information.
  1904.  
  1905.  
  1906.  
  1907.  
  1908.    Wray             Document Expiration: 31 September 1993        [Page 29]
  1909.  
  1910.  
  1911.  
  1912.  
  1913.  
  1914.  
  1915.  
  1916.    INTERNET-DRAFT      GSSAPI - Overview and C bindings          March 1993
  1917.  
  1918.  
  1919.  
  1920.    5.11. gss_unseal
  1921.  
  1922.       OM_uint32  gss_unseal (
  1923.                      OM_uint32 *     minor_status,
  1924.                      gss_ctx_id_t    context_handle,
  1925.                      gss_buffer_t    input_message_buffer,
  1926.                      gss_buffer_t    output_message_buffer,
  1927.                      int *           conf_state,
  1928.                      int *           qop_state)
  1929.  
  1930.    Purpose:
  1931.  
  1932.       Converts a previously sealed message back to a usable form, verifying
  1933.       the embedded signature.  The conf_state parameter indicates whether
  1934.       the message was encrypted; the qop_state parameter indicates the
  1935.       strength of protection that was used to provide the confidentiality
  1936.       and integrity services.
  1937.  
  1938.    Parameters:
  1939.  
  1940.       minor_status      integer, modify
  1941.                         Mechanism specific status code.
  1942.  
  1943.       context_handle    gss_ctx_id_t, read
  1944.                         identifies the context on which the message
  1945.                         arrived
  1946.  
  1947.       input_message_buffer   buffer, opaque, read
  1948.                              sealed message
  1949.  
  1950.       output_message_buffer  buffer, opaque, modify
  1951.                              buffer to receive unsealed message
  1952.  
  1953.       conf_state        boolean, modify
  1954.                         True - Confidentiality and integrity protection
  1955.                                were used
  1956.                         False - Inteegrity service only was used
  1957.  
  1958.       qop_state         integer, modify
  1959.                         quality of protection gained from signature
  1960.  
  1961.    Function value:
  1962.  
  1963.       GSS status code:
  1964.  
  1965.       GSS_S_COMPLETE    Successful completion
  1966.  
  1967.       GSS_S_DEFECTIVE_TOKEN The token failed consistency checks
  1968.  
  1969.       GSS_S_BAD_SIG     The signature was incorrect
  1970.  
  1971.  
  1972.  
  1973.  
  1974.    Wray             Document Expiration: 31 September 1993        [Page 30]
  1975.  
  1976.  
  1977.  
  1978.  
  1979.  
  1980.  
  1981.  
  1982.    INTERNET-DRAFT      GSSAPI - Overview and C bindings          March 1993
  1983.  
  1984.  
  1985.  
  1986.       GSS_S_DUPLICATE_TOKEN The token was valid, and contained a correct
  1987.                         signature for the message, but it had already been
  1988.                         processed
  1989.  
  1990.       GSS_S_OLD_TOKEN   The token was valid, and contained a correct
  1991.                         signature for the message, but it is too old
  1992.  
  1993.       GSS_S_UNSEQ_TOKEN The token was valid, and contained a correct
  1994.                         signature for the message, but has been verified
  1995.                         out of sequence; an earlier token has been signed
  1996.                         or sealed by the remote application, but not yet
  1997.                         been processed locally.
  1998.  
  1999.       GSS_S_CONTEXT_EXPIRED The context has already expired
  2000.  
  2001.       GSS_S_CREDENTIALS_EXPIRED The context is recognized, but associated
  2002.                         credentials have expired
  2003.  
  2004.       GSS_S_NO_CONTEXT  The context_handle parameter did not identify a
  2005.                         valid context
  2006.  
  2007.       GSS_S_FAILURE     Failure.  See minor_status for more information.
  2008.  
  2009.  
  2010.    5.12. gss_display_status
  2011.  
  2012.       OM_uint32  gss_display_status (
  2013.                      OM_uint32 *     minor_status,
  2014.                      int             status_value,
  2015.                      int             status_type,
  2016.                      gss_OID         mech_type,
  2017.                      int *           message_context,
  2018.                      gss_buffer_t    status_string)
  2019.  
  2020.    Purpose:
  2021.  
  2022.       Allows an application to obtain a textual representation of a GSSAPI
  2023.       status code, for display to the user or for logging purposes.  Since
  2024.       some status values may indicate multiple errors, applications may
  2025.       need to call     gss_display_status multiple times, each call
  2026.       generating a single text string.  The message_context parameter is
  2027.       used to indicate which error message should be extracted from a given
  2028.       status_value; message_context should be initialized to 0, and
  2029.       gss_display_status will return a non-zero value if there are further
  2030.       messages to extract.
  2031.  
  2032.    Parameters:
  2033.  
  2034.       minor_status      integer, modify
  2035.                         Mechanism specific status code.
  2036.  
  2037.  
  2038.  
  2039.  
  2040.    Wray             Document Expiration: 31 September 1993        [Page 31]
  2041.  
  2042.  
  2043.  
  2044.  
  2045.  
  2046.  
  2047.  
  2048.    INTERNET-DRAFT      GSSAPI - Overview and C bindings          March 1993
  2049.  
  2050.  
  2051.  
  2052.       status_value      integer, read
  2053.                         Status value to be converted
  2054.  
  2055.       status_type       integer, read
  2056.                         GSS_C_GSS_CODE - status_value is a GSS status
  2057.                                          code
  2058.                         GSS_C_MECH_CODE - status_value is a mechanism
  2059.                                           status code
  2060.  
  2061.       mech_type         Object ID, read, optional
  2062.                         Underlying mechanism (used to interpret a
  2063.                         minor status value) Supply GSS_C_NULL_OID to
  2064.                         obtain the system default.
  2065.  
  2066.       message_context   integer, read/modify
  2067.                         Should be initialized to zero by caller
  2068.                         on first call.  If further messages are
  2069.                         contained in the status_value parameter,
  2070.                         message_context will be non-zero on return,
  2071.                         and this value should be passed back to
  2072.                         subsequent calls, along with the same
  2073.                         status_value, status_type and mech_type
  2074.                         parameters.
  2075.  
  2076.       status_string     buffer, character string, modify
  2077.                         textual interpretation of the status_value
  2078.  
  2079.    Function value:
  2080.  
  2081.       GSS status code:
  2082.  
  2083.       GSS_S_COMPLETE    Successful completion
  2084.  
  2085.       GSS_S_BAD_MECH    Indicates that translation in accordance with an
  2086.                         unsupported mechanism type was requested
  2087.  
  2088.       GSS_S_BAD_STATUS  The status value was not recognized, or the status
  2089.                         type was neither GSS_C_GSS_CODE nor
  2090.                         GSS_C_MECH_CODE.
  2091.  
  2092.  
  2093.    5.13. gss_indicate_mechs
  2094.  
  2095.       OM_uint32  gss_indicate_mechs (
  2096.                      OM_uint32 *     minor_status,
  2097.                      gss_OID_set *   mech_set)
  2098.  
  2099.    Purpose:
  2100.  
  2101.       Allows an application to determine which underlying security
  2102.       mechanisms are available.
  2103.  
  2104.  
  2105.  
  2106.    Wray             Document Expiration: 31 September 1993        [Page 32]
  2107.  
  2108.  
  2109.  
  2110.  
  2111.  
  2112.  
  2113.  
  2114.    INTERNET-DRAFT      GSSAPI - Overview and C bindings          March 1993
  2115.  
  2116.  
  2117.  
  2118.    Parameters:
  2119.  
  2120.       minor_status      integer, modify
  2121.                         Mechanism specific status code.
  2122.  
  2123.       mech_set          set of Object IDs, modify
  2124.                         set of implementation-supported mechanisms.
  2125.                         The returned gss_OID_set value will be a
  2126.                         pointer into static storage, and should be
  2127.                         treated as read-only by the caller.
  2128.  
  2129.    Function value:
  2130.  
  2131.       GSS status code:
  2132.  
  2133.       GSS_S_COMPLETE    Successful completion
  2134.  
  2135.  
  2136.    5.14. gss_compare_name
  2137.  
  2138.       OM_uint32  gss_compare_name (
  2139.                      OM_uint32 *     minor_status,
  2140.                      gss_name_t      name1,
  2141.                      gss_name_t      name2,
  2142.                      int *           name_equal)
  2143.  
  2144.    Purpose:
  2145.  
  2146.       Allows an application to compare two internal-form  names to
  2147.       determine whether they refer to the same entity.
  2148.  
  2149.    Parameters:
  2150.  
  2151.       minor_status      integer, modify
  2152.                         Mechanism specific status code.
  2153.  
  2154.       name1             gss_name_t, read
  2155.                         internal-form  name
  2156.  
  2157.       name2             gss_name_t, read
  2158.                         internal-form  name
  2159.  
  2160.       name_equal        boolean, modify
  2161.                         True - names refer to same entity
  2162.                         False - names refer to different entities
  2163.                                 (strictly, the names are not known to
  2164.                                 refer to the same identity).
  2165.  
  2166.    Function value:
  2167.  
  2168.  
  2169.  
  2170.  
  2171.  
  2172.    Wray             Document Expiration: 31 September 1993        [Page 33]
  2173.  
  2174.  
  2175.  
  2176.  
  2177.  
  2178.  
  2179.  
  2180.    INTERNET-DRAFT      GSSAPI - Overview and C bindings          March 1993
  2181.  
  2182.  
  2183.  
  2184.       GSS status code:
  2185.  
  2186.       GSS_S_COMPLETE    Successful completion
  2187.  
  2188.       GSS_S_BAD_NAMETYPE The type contained within either name1 or name2
  2189.                         was unrecognized, or the names were of incomparable
  2190.                         types.
  2191.  
  2192.       GSS_S_BAD_NAME    One or both of name1 or name2 was ill-formed
  2193.  
  2194.  
  2195.    5.15. gss_display_name
  2196.  
  2197.       OM_uint32  gss_display_name (
  2198.                      OM_uint32 *     minor_status,
  2199.                      gss_name_t      input_name,
  2200.                      gss_buffer_t    output_name_buffer,
  2201.                      gss_OID *       output_name_type)
  2202.  
  2203.    Purpose:
  2204.  
  2205.       Allows an application to obtain a textual representation of an opaque
  2206.       internal-form  name for display purposes.  The syntax of a printable
  2207.       name is defined by the GSSAPI implementation.
  2208.  
  2209.    Parameters:
  2210.  
  2211.       minor_status      integer, modify
  2212.                         Mechanism specific status code.
  2213.  
  2214.       input_name        gss_name_t, read
  2215.                         name to be displayed
  2216.  
  2217.       output_name_buffer   buffer, character-string, modify
  2218.                            buffer to receive textual name string
  2219.  
  2220.       output_name_type  Object ID, modify
  2221.                         The type of the returned name.  The returned
  2222.                         gss_OID will be a pointer into static storage,
  2223.                         and should be treated as read-only by the caller
  2224.  
  2225.    Function value:
  2226.  
  2227.       GSS status code:
  2228.  
  2229.       GSS_S_COMPLETE    Successful completion
  2230.  
  2231.       GSS_S_BAD_NAMETYPE The type of input_name was not recognized
  2232.  
  2233.       GSS_S_BAD_NAME    input_name was ill-formed
  2234.  
  2235.  
  2236.  
  2237.  
  2238.    Wray             Document Expiration: 31 September 1993        [Page 34]
  2239.  
  2240.  
  2241.  
  2242.  
  2243.  
  2244.  
  2245.  
  2246.    INTERNET-DRAFT      GSSAPI - Overview and C bindings          March 1993
  2247.  
  2248.  
  2249.  
  2250.    5.16. gss_import_name
  2251.  
  2252.       OM_uint32 gss_import_name (
  2253.                     OM_uint32 *     minor_status,
  2254.                     gss_buffer_t    input_name_buffer,
  2255.                     gss_OID         input_name_type,
  2256.                     gss_name_t *    output_name)
  2257.  
  2258.    Purpose:
  2259.  
  2260.       Convert a printable name to internal form.
  2261.  
  2262.    Parameters:
  2263.  
  2264.       minor_status      integer, modify
  2265.                         Mechanism specific status code
  2266.  
  2267.       input_name_buffer    buffer, character-string, read
  2268.                            buffer containing printable name to convert
  2269.  
  2270.       input_name_type   Object ID, read, optional
  2271.                         Object Id specifying type of printable
  2272.                         name.  Applications may specify either
  2273.                         GSS_C_NULL_OID to use a local system-specific
  2274.                         printable syntax, or an OID registered by the
  2275.                         GSSAPI implementation to name a particular
  2276.                         namespace.
  2277.  
  2278.       output_name       gss_name_t, modify
  2279.                         returned name in internal form
  2280.  
  2281.    Function value:
  2282.  
  2283.       GSS status code
  2284.  
  2285.       GSS_S_COMPLETE    Successful completion
  2286.  
  2287.       GSS_S_BAD_NAMETYPE The input_name_type was unrecognized
  2288.  
  2289.       GSS_S_BAD_NAME    The input_name parameter could not be interpreted
  2290.                         as a name of the specified type
  2291.  
  2292.  
  2293.    5.17. gss_release_name
  2294.  
  2295.       OM_uint32 gss_release_name (
  2296.                     OM_uint32 *     minor_status,
  2297.                     gss_name_t *    name)
  2298.  
  2299.    Purpose:
  2300.  
  2301.  
  2302.  
  2303.  
  2304.    Wray             Document Expiration: 31 September 1993        [Page 35]
  2305.  
  2306.  
  2307.  
  2308.  
  2309.  
  2310.  
  2311.  
  2312.    INTERNET-DRAFT      GSSAPI - Overview and C bindings          March 1993
  2313.  
  2314.  
  2315.  
  2316.       Free GSSAPI-allocated storage associated with an internal form name.
  2317.  
  2318.    Parameters:
  2319.  
  2320.       minor_status      integer, modify
  2321.                         Mechanism specific status code
  2322.  
  2323.       name              gss_name_t, modify
  2324.                         The name to be deleted
  2325.  
  2326.    Function value:
  2327.  
  2328.       GSS status code
  2329.  
  2330.       GSS_S_COMPLETE    Successful completion
  2331.  
  2332.       GSS_S_BAD_NAME    The name parameter did not contain a valid name
  2333.  
  2334.  
  2335.    5.18. gss_release_buffer
  2336.  
  2337.       OM_uint32 gss_release_buffer (
  2338.                     OM_uint32 *     minor_status,
  2339.                     gss_buffer_t    buffer)
  2340.  
  2341.    Purpose:
  2342.  
  2343.       Free storage associated with a buffer format name.  The storage must
  2344.       have been allocated by a GSSAPI routine.  In addition to freeing the
  2345.       associated storage, the routine will zero the length field in the
  2346.       buffer parameter.
  2347.  
  2348.    Parameters:
  2349.  
  2350.       minor_status      integer, modify
  2351.                         Mechanism specific status code
  2352.  
  2353.       buffer            buffer, modify
  2354.                         The storage associated with the buffer will be
  2355.                         deleted.  The gss_buffer_desc object will not
  2356.                         be freed, but its length field will be zeroed.
  2357.  
  2358.    Function value:
  2359.  
  2360.       GSS status code
  2361.  
  2362.       GSS_S_COMPLETE    Successful completion
  2363.  
  2364.  
  2365.  
  2366.  
  2367.  
  2368.  
  2369.  
  2370.    Wray             Document Expiration: 31 September 1993        [Page 36]
  2371.  
  2372.  
  2373.  
  2374.  
  2375.  
  2376.  
  2377.  
  2378.    INTERNET-DRAFT      GSSAPI - Overview and C bindings          March 1993
  2379.  
  2380.  
  2381.  
  2382.    5.19. gss_release_oid_set
  2383.  
  2384.       OM_uint32 gss_release_oid_set (
  2385.                     OM_uint32 *     minor_status,
  2386.                     gss_OID_set *   set)
  2387.  
  2388.    Purpose:
  2389.  
  2390.       Free storage associated with a    gss_OID_set object.  The storage
  2391.       must have been allocated by a GSSAPI routine.
  2392.  
  2393.    Parameters:
  2394.  
  2395.       minor_status      integer, modify
  2396.                         Mechanism specific status code
  2397.  
  2398.       set               Set of Object IDs, modify
  2399.                         The storage associated with the gss_OID_set
  2400.                         will be deleted.
  2401.  
  2402.    Function value:
  2403.  
  2404.       GSS status code
  2405.  
  2406.       GSS_S_COMPLETE    Successful completion
  2407.  
  2408.  
  2409.    5.20. gss_inquire_cred
  2410.  
  2411.       OM_uint32 gss_inquire_cred (
  2412.                     OM_uint32  *    minor_status,
  2413.                     gss_cred_id_t   cred_handle,
  2414.                     gss_name_t *    name,
  2415.                     OM_uint32 *     lifetime,
  2416.                     int *           cred_usage,
  2417.                     gss_OID_set *   mechanisms )
  2418.  
  2419.    Purpose:
  2420.  
  2421.       Obtains information about a credential.  The caller must already have
  2422.       obtained a handle that refers to the credential.
  2423.  
  2424.    Parameters:
  2425.  
  2426.       minor_status      integer, modify
  2427.                         Mechanism specific status code
  2428.  
  2429.       cred_handle       gss_cred_id_t, read
  2430.                         A handle that refers to the target credential.
  2431.                         Specify GSS_C_NO_CREDENTIAL to inquire about
  2432.                         the default credential.
  2433.  
  2434.  
  2435.  
  2436.    Wray             Document Expiration: 31 September 1993        [Page 37]
  2437.  
  2438.  
  2439.  
  2440.  
  2441.  
  2442.  
  2443.  
  2444.    INTERNET-DRAFT      GSSAPI - Overview and C bindings          March 1993
  2445.  
  2446.  
  2447.  
  2448.       name              gss_name_t, modify
  2449.                         The name whose identity the credential asserts.
  2450.                         Specify NULL if not required.
  2451.  
  2452.       lifetime          Integer, modify
  2453.                         The number of seconds for which the credential
  2454.                         will remain valid.  If the credential has
  2455.                         expired, this parameter will be set to zero.
  2456.                         If the implementation does not support
  2457.                         credential expiration, the value
  2458.                         GSS_C_INDEFINITE will be returned.  Specify
  2459.                         NULL if not required.
  2460.  
  2461.       cred_usage        Integer, modify
  2462.                         How the credential may be used.  One of the
  2463.                         following:
  2464.                            GSS_C_INITIATE
  2465.                            GSS_C_ACCEPT
  2466.                            GSS_C_BOTH
  2467.                         Specify NULL if not required.
  2468.  
  2469.       mechanisms        gss_OID_set, modify
  2470.                         Set of mechanisms supported by the credential.
  2471.                         Specify NULL if not required.
  2472.  
  2473.    Function value:
  2474.  
  2475.       GSS status code
  2476.  
  2477.       GSS_S_COMPLETE    Successful completion
  2478.  
  2479.       GSS_S_NO_CRED     The referenced credentials could not be accessed.
  2480.  
  2481.       GSS_S_DEFECTIVE_CREDENTIAL The referenced credentials were invalid.
  2482.  
  2483.       GSS_S_CREDENTIALS_EXPIRED The referenced credentials have expired.
  2484.                         If the lifetime parameter was not passed as NULL,
  2485.                         it will be set to 0.
  2486.  
  2487.  
  2488.  
  2489.  
  2490.  
  2491.  
  2492.  
  2493.  
  2494.  
  2495.  
  2496.  
  2497.  
  2498.  
  2499.  
  2500.  
  2501.  
  2502.    Wray             Document Expiration: 31 September 1993        [Page 38]
  2503.  
  2504.  
  2505.  
  2506.  
  2507.  
  2508.  
  2509.  
  2510.    INTERNET-DRAFT      GSSAPI - Overview and C bindings          March 1993
  2511.  
  2512.  
  2513.  
  2514.       #ifndef GSSAPI_H_
  2515.       #define GSSAPI_H_
  2516.  
  2517.       /*
  2518.        * First, define the platform-dependent types.
  2519.        */
  2520.       typedef <platform-specific> OM_uint32;
  2521.       typedef <platform-specific> gss_ctx_id_t;
  2522.       typedef <platform-specific> gss_cred_id_t;
  2523.       typedef <platform-specific> gss_name_t;
  2524.  
  2525.       /*
  2526.        * Note that a platform supporting the xom.h X/Open header file
  2527.        * may make use of that header for the definitions of OM_uint32
  2528.        * and the structure to which gss_OID_desc equates.
  2529.        */
  2530.  
  2531.       typedef struct gss_OID_desc_struct {
  2532.             OM_uint32 length;
  2533.             void      *elements;
  2534.       } gss_OID_desc, *gss_OID;
  2535.  
  2536.       typedef struct gss_OID_set_desc_struct  {
  2537.             int     count;
  2538.             gss_OID elements;
  2539.       } gss_OID_set_desc, *gss_OID_set;
  2540.  
  2541.       typedef struct gss_buffer_desc_struct {
  2542.             size_t length;
  2543.             void *value;
  2544.       } gss_buffer_desc, *gss_buffer_t;
  2545.  
  2546.       typedef struct gss_channel_bindings_struct {
  2547.             OM_uint32 initiator_addrtype;
  2548.             gss_buffer_desc initiator_address;
  2549.             OM_uint32 acceptor_addrtype;
  2550.             gss_buffer_desc acceptor_address;
  2551.             gss_buffer_desc application_data;
  2552.       } *gss_channel_bindings_t;
  2553.  
  2554.  
  2555.       /*
  2556.        * Six independent flags each of which indicates that a context
  2557.        * supports a specific service option.
  2558.        */
  2559.       #define GSS_C_DELEG_FLAG 1
  2560.       #define GSS_C_MUTUAL_FLAG 2
  2561.       #define GSS_C_REPLAY_FLAG 4
  2562.       #define GSS_C_SEQUENCE_FLAG 8
  2563.       #define GSS_C_CONF_FLAG 16
  2564.       #define GSS_C_INTEG_FLAG 32
  2565.  
  2566.  
  2567.  
  2568.    Wray             Document Expiration: 31 September 1993        [Page 39]
  2569.  
  2570.  
  2571.  
  2572.  
  2573.  
  2574.  
  2575.  
  2576.    INTERNET-DRAFT      GSSAPI - Overview and C bindings          March 1993
  2577.  
  2578.  
  2579.  
  2580.       /*
  2581.        * Credential usage options
  2582.        */
  2583.       #define GSS_C_BOTH 0
  2584.       #define GSS_C_INITIATE 1
  2585.       #define GSS_C_ACCEPT 2
  2586.  
  2587.       /*
  2588.        * Status code types for gss_display_status
  2589.        */
  2590.       #define GSS_C_GSS_CODE 1
  2591.       #define GSS_C_MECH_CODE 2
  2592.  
  2593.       /*
  2594.        * The constant definitions for channel-bindings address families
  2595.        */
  2596.       #define GSS_C_AF_UNSPEC     0;
  2597.       #define GSS_C_AF_LOCAL      1;
  2598.       #define GSS_C_AF_INET       2;
  2599.       #define GSS_C_AF_IMPLINK    3;
  2600.       #define GSS_C_AF_PUP        4;
  2601.       #define GSS_C_AF_CHAOS      5;
  2602.       #define GSS_C_AF_NS         6;
  2603.       #define GSS_C_AF_NBS        7;
  2604.       #define GSS_C_AF_ECMA       8;
  2605.       #define GSS_C_AF_DATAKIT    9;
  2606.       #define GSS_C_AF_CCITT      10;
  2607.       #define GSS_C_AF_SNA        11;
  2608.       #define GSS_C_AF_DECnet     12;
  2609.       #define GSS_C_AF_DLI        13;
  2610.       #define GSS_C_AF_LAT        14;
  2611.       #define GSS_C_AF_HYLINK     15;
  2612.       #define GSS_C_AF_APPLETALK  16;
  2613.       #define GSS_C_AF_BSC        17;
  2614.       #define GSS_C_AF_DSS        18;
  2615.       #define GSS_C_AF_OSI        19;
  2616.       #define GSS_C_AF_X25        21;
  2617.  
  2618.       #define GSS_C_AF_NULLADDR   255;
  2619.  
  2620.       #define GSS_C_NO_BUFFER ((gss_buffer_t) 0)
  2621.       #define GSS_C_NULL_OID ((gss_OID) 0)
  2622.       #define GSS_C_NULL_OID_SET ((gss_OID_set) 0)
  2623.       #define GSS_C_NO_CONTEXT ((gss_ctx_id_t) 0)
  2624.       #define GSS_C_NO_CREDENTIAL ((gss_cred_id_t) 0)
  2625.       #define GSS_C_NO_CHANNEL_BINDINGS ((gss_channel_bindings_t) 0)
  2626.       #define GSS_C_EMPTY_BUFFER {0, NULL}
  2627.  
  2628.       /*
  2629.        * Define the default Quality of Protection for per-message
  2630.        * services.  Note that an implementation that offers multiple
  2631.  
  2632.  
  2633.  
  2634.    Wray             Document Expiration: 31 September 1993        [Page 40]
  2635.  
  2636.  
  2637.  
  2638.  
  2639.  
  2640.  
  2641.  
  2642.    INTERNET-DRAFT      GSSAPI - Overview and C bindings          March 1993
  2643.  
  2644.  
  2645.  
  2646.        * levels of QOP may either reserve a value (for example zero,
  2647.        * as assumed here) to mean "default protection", or alternatively
  2648.        * may simply equate GSS_C_QOP_DEFAULT to a specific explicit QOP
  2649.        * value.
  2650.        */
  2651.       #define GSS_C_QOP_DEFAULT 0
  2652.  
  2653.       /*
  2654.        * Expiration time of 2^32-1 seconds means infinite lifetime for a
  2655.        * credential or security context
  2656.        */
  2657.       #define GSS_C_INDEFINITE 0xfffffffful
  2658.  
  2659.  
  2660.       /* Major status codes */
  2661.  
  2662.       #define GSS_S_COMPLETE 0
  2663.  
  2664.       /*
  2665.        * Some "helper" definitions to make the status code macros obvious.
  2666.        */
  2667.       #define GSS_C_CALLING_ERROR_OFFSET 24
  2668.       #define GSS_C_ROUTINE_ERROR_OFFSET 16
  2669.       #define GSS_C_SUPPLEMENTARY_OFFSET 0
  2670.       #define GSS_C_CALLING_ERROR_MASK 0377ul
  2671.       #define GSS_C_ROUTINE_ERROR_MASK 0377ul
  2672.       #define GSS_C_SUPPLEMENTARY_MASK 0177777ul
  2673.  
  2674.       /*
  2675.        * The macros that test status codes for error conditions
  2676.        */
  2677.       #define GSS_CALLING_ERROR(x) \
  2678.         (x & (GSS_C_CALLING_ERROR_MASK << GSS_C_CALLING_ERROR_OFFSET))
  2679.       #define GSS_ROUTINE_ERROR(x) \
  2680.         (x & (GSS_C_ROUTINE_ERROR_MASK << GSS_C_ROUTINE_ERROR_OFFSET))
  2681.       #define GSS_SUPPLEMENTARY_INFO(x) \
  2682.         (x & (GSS_C_SUPPLEMENTARY_MASK << GSS_C_SUPPLEMENTARY_OFFSET))
  2683.       #define GSS_ERROR(x) \
  2684.         ((GSS_CALLING_ERROR(x) != 0) || (GSS_ROUTINE_ERROR(x) != 0))
  2685.  
  2686.  
  2687.       /*
  2688.        * Now the actual status code definitions
  2689.        */
  2690.  
  2691.       /*
  2692.        * Calling errors:
  2693.        */
  2694.       #define GSS_S_CALL_INACCESSIBLE_READ \
  2695.                                    (1ul << GSS_C_CALLING_ERROR_OFFSET)
  2696.       #define GSS_S_CALL_INACCESSIBLE_WRITE \
  2697.  
  2698.  
  2699.  
  2700.    Wray             Document Expiration: 31 September 1993        [Page 41]
  2701.  
  2702.  
  2703.  
  2704.  
  2705.  
  2706.  
  2707.  
  2708.    INTERNET-DRAFT      GSSAPI - Overview and C bindings          March 1993
  2709.  
  2710.  
  2711.  
  2712.                                    (2ul << GSS_C_CALLING_ERROR_OFFSET)
  2713.       #define GSS_S_CALL_BAD_STRUCTURE \
  2714.                                    (3ul << GSS_C_CALLING_ERROR_OFFSET)
  2715.  
  2716.       /*
  2717.        * Routine errors:
  2718.        */
  2719.       #define GSS_S_BAD_MECH (1ul << GSS_C_ROUTINE_ERROR_OFFSET)
  2720.       #define GSS_S_BAD_NAME (2ul << GSS_C_ROUTINE_ERROR_OFFSET)
  2721.       #define GSS_S_BAD_NAMETYPE (3ul << GSS_C_ROUTINE_ERROR_OFFSET)
  2722.       #define GSS_S_BAD_BINDINGS (4ul << GSS_C_ROUTINE_ERROR_OFFSET)
  2723.       #define GSS_S_BAD_STATUS (5ul << GSS_C_ROUTINE_ERROR_OFFSET)
  2724.       #define GSS_S_BAD_SIG (6ul << GSS_C_ROUTINE_ERROR_OFFSET)
  2725.       #define GSS_S_NO_CRED (7ul << GSS_C_ROUTINE_ERROR_OFFSET)
  2726.       #define GSS_S_NO_CONTEXT (8ul << GSS_C_ROUTINE_ERROR_OFFSET)
  2727.       #define GSS_S_DEFECTIVE_TOKEN (9ul << GSS_C_ROUTINE_ERROR_OFFSET)
  2728.       #define GSS_S_DEFECTIVE_CREDENTIAL (10ul << GSS_C_ROUTINE_ERROR_OFFSET)
  2729.       #define GSS_S_CREDENTIALS_EXPIRED (11ul << GSS_C_ROUTINE_ERROR_OFFSET)
  2730.       #define GSS_S_CONTEXT_EXPIRED (12ul << GSS_C_ROUTINE_ERROR_OFFSET)
  2731.       #define GSS_S_FAILURE (13ul << GSS_C_ROUTINE_ERROR_OFFSET)
  2732.  
  2733.       /*
  2734.        * Supplementary info bits:
  2735.        */
  2736.       #define GSS_S_CONTINUE_NEEDED (1ul << (GSS_C_SUPPLEMENTARY_OFFSET + 0))
  2737.       #define GSS_S_DUPLICATE_TOKEN (1ul << (GSS_C_SUPPLEMENTARY_OFFSET + 1))
  2738.       #define GSS_S_OLD_TOKEN (1ul << (GSS_C_SUPPLEMENTARY_OFFSET + 2))
  2739.       #define GSS_S_UNSEQ_TOKEN (1ul << (GSS_C_SUPPLEMENTARY_OFFSET + 3))
  2740.  
  2741.  
  2742.       /*
  2743.        * Finally, function prototypes for the GSSAPI routines.
  2744.        */
  2745.  
  2746.       OM_uint32 gss_acquire_cred
  2747.                  (OM_uint32*,       /* minor_status */
  2748.                   gss_name_t,       /* desired_name */
  2749.                   OM_uint32,        /* time_req */
  2750.                   gss_OID_set,      /* desired_mechs */
  2751.                   int,              /* cred_usage */
  2752.                   gss_cred_id_t*,   /* output_cred_handle */
  2753.                   gss_OID_set*,     /* actual_mechs */
  2754.                   OM_uint32*        /* time_rec */
  2755.                  );
  2756.  
  2757.       OM_uint32 gss_release_cred,
  2758.                  (OM_uint32*,       /* minor_status */
  2759.                   gss_cred_id_t*    /* cred_handle */
  2760.                  );
  2761.  
  2762.       OM_uint32 gss_init_sec_context
  2763.  
  2764.  
  2765.  
  2766.    Wray             Document Expiration: 31 September 1993        [Page 42]
  2767.  
  2768.  
  2769.  
  2770.  
  2771.  
  2772.  
  2773.  
  2774.    INTERNET-DRAFT      GSSAPI - Overview and C bindings          March 1993
  2775.  
  2776.  
  2777.  
  2778.                  (OM_uint32*,       /* minor_status */
  2779.                   gss_cred_id_t,    /* claimant_cred_handle */
  2780.                   gss_ctx_id_t*,    /* context_handle */
  2781.                   gss_name_t,       /* target_name */
  2782.                   gss_OID,          /* mech_type */
  2783.                   int,              /* req_flags */
  2784.                   OM_uint32,        /* time_req */
  2785.                   gss_channel_bindings_t,
  2786.                                     /* input_chan_bindings */
  2787.                   gss_buffer_t,     /* input_token */
  2788.                   gss_OID*,         /* actual_mech_type */
  2789.                   gss_buffer_t,     /* output_token */
  2790.                   int*,             /* ret_flags */
  2791.                   OM_uint32*        /* time_rec */
  2792.                  );
  2793.  
  2794.       OM_uint32 gss_accept_sec_context
  2795.                  (OM_uint32*,       /* minor_status */
  2796.                   gss_ctx_id_t*,    /* context_handle */
  2797.                   gss_cred_id_t,    /* verifier_cred_handle */
  2798.                   gss_buffer_t,     /* input_token_buffer */
  2799.                   gss_channel_bindings_t,
  2800.                                     /* input_chan_bindings */
  2801.                   gss_name_t*,      /* src_name */
  2802.                   gss_OID*,         /* mech_type */
  2803.                   gss_buffer_t,     /* output_token */
  2804.                   int*,             /* ret_flags */
  2805.                   OM_uint32*,       /* time_rec */
  2806.                   gss_cred_id_t*    /* delegated_cred_handle */
  2807.                  );
  2808.  
  2809.       OM_uint32 gss_process_context_token
  2810.                  (OM_uint32*,       /* minor_status */
  2811.                   gss_ctx_id_t,     /* context_handle */
  2812.                   gss_buffer_t      /* token_buffer */
  2813.                  );
  2814.  
  2815.       OM_uint32 gss_delete_sec_context
  2816.                  (OM_uint32*,       /* minor_status */
  2817.                   gss_ctx_id_t,     /* context_handle */
  2818.                   gss_buffer_t      /* output_token */
  2819.                  );
  2820.  
  2821.       OM_uint32 gss_context_time
  2822.                  (OM_uint32*,       /* minor_status */
  2823.                   gss_ctx_id_t,     /* context_handle */
  2824.                   OM_uint32*        /* time_rec */
  2825.                  );
  2826.  
  2827.       OM_uint32 gss_sign
  2828.                  (OM_uint32*,       /* minor_status */
  2829.  
  2830.  
  2831.  
  2832.    Wray             Document Expiration: 31 September 1993        [Page 43]
  2833.  
  2834.  
  2835.  
  2836.  
  2837.  
  2838.  
  2839.  
  2840.    INTERNET-DRAFT      GSSAPI - Overview and C bindings          March 1993
  2841.  
  2842.  
  2843.  
  2844.                   gss_ctx_id_t,     /* context_handle */
  2845.                   int,              /* qop_req */
  2846.                   gss_buffer_t,     /* message_buffer */
  2847.                   gss_buffer_t      /* message_token */
  2848.                  );
  2849.  
  2850.       OM_uitn32 gss_verify
  2851.                  (OM_uint32*,       /* minor_status */
  2852.                   gss_ctx_id_t,     /* context_handle */
  2853.                   gss_buffer_t,     /* message_buffer */
  2854.                   gss_buffer_t,     /* token_buffer */
  2855.                   int*              /* qop_state */
  2856.                  );
  2857.  
  2858.       OM_uint32 gss_seal
  2859.                  (OM_uint32*,       /* minor_status */
  2860.                   gss_ctx_id_t,     /* context_handle */
  2861.                   int,              /* conf_req_flag */
  2862.                   int,              /* qop_req */
  2863.                   gss_buffer_t,     /* input_message_buffer */
  2864.                   int*,             /* conf_state */
  2865.                   gss_buffer_t      /* output_message_buffer */
  2866.                  );
  2867.  
  2868.       OM_uint32 gss_unseal
  2869.                  (OM_uint32*,       /* minor_status */
  2870.                   gss_ctx_id_t,     /* context_handle */
  2871.                   gss_buffer_t,     /* input_message_buffer */
  2872.                   gss_buffer_t,     /* output_message_buffer */
  2873.                   int*,             /* conf_state */
  2874.                   int*              /* qop_state */
  2875.                  );
  2876.  
  2877.       OM_uint32 gss_display_status
  2878.                  (OM_uint32*,       /* minor_status */
  2879.                   OM_uint32,        /* status_value */
  2880.                   int,              /* status_type */
  2881.                   gss_OID,          /* mech_type */
  2882.                   int*,             /* message_context */
  2883.                   gss_buffer_t      /* status_string */
  2884.                  );
  2885.  
  2886.       OM_uint32 gss_indicate_mechs
  2887.                  (OM_uint32*,       /* minor_status */
  2888.                   gss_OID_set*      /* mech_set */
  2889.                  );
  2890.  
  2891.       OM_uint32 gss_compare_name
  2892.                  (OM_uint32*,       /* minor_status */
  2893.                   gss_name_t,       /* name1 */
  2894.                   gss_name_t,       /* name2 */
  2895.  
  2896.  
  2897.  
  2898.    Wray             Document Expiration: 31 September 1993        [Page 44]
  2899.  
  2900.  
  2901.  
  2902.  
  2903.  
  2904.  
  2905.  
  2906.    INTERNET-DRAFT      GSSAPI - Overview and C bindings          March 1993
  2907.  
  2908.  
  2909.  
  2910.                   int*              /* name_equal */
  2911.                  );
  2912.  
  2913.       OM_uint32 gss_display_name,
  2914.                  (OM_uint32*,      /* minor_status */
  2915.                   gss_name_t,      /* input_name */
  2916.                   gss_buffer_t,     /* output_name_buffer */
  2917.                   gss_OID*         /* output_name_type */
  2918.                  );
  2919.  
  2920.       OM_uint32 gss_import_name
  2921.                  (OM_uint32*,       /* minor_status */
  2922.                   gss_buffer_t,     /* input_name_buffer */
  2923.                   gss_OID,          /* input_name_type */
  2924.                   gss_name_t*       /* output_name */
  2925.                  );
  2926.  
  2927.       OM_uint32 gss_release_name
  2928.                  (OM_uint32*,       /* minor_status */
  2929.                   gss_name_t*       /* input_name */
  2930.                  );
  2931.  
  2932.       OM_uint32 gss_release_buffer
  2933.                  (OM_uint32*,       /* minor_status */
  2934.                   gss_buffer_t      /* buffer */
  2935.                  );
  2936.  
  2937.       OM_uint32 gss_release_oid_set
  2938.                  (OM_uint32*,       /* minor_status */
  2939.                   gss_OID_set*      /* set */
  2940.                  );
  2941.  
  2942.       OM_uint32 gss_inquire_cred
  2943.                  (OM_uint32 *,      /* minor_status */
  2944.                   gss_cred_id_t,    /* cred_handle */
  2945.                   gss_name_t *,     /* name */
  2946.                   OM_uint32 *,      /* lifetime */
  2947.                   int *,            /* cred_usage */
  2948.                   gss_OID_set *     /* mechanisms */
  2949.                  );
  2950.  
  2951.  
  2952.  
  2953.       #endif /* GSSAPI_H_ */
  2954.  
  2955.  
  2956.  
  2957.  
  2958.  
  2959.  
  2960.  
  2961.  
  2962.  
  2963.  
  2964.    Wray             Document Expiration: 31 September 1993        [Page 45]
  2965.  
  2966.  
  2967.  
  2968.  
  2969.  
  2970.  
  2971.  
  2972.    INTERNET-DRAFT      GSSAPI - Overview and C bindings          March 1993
  2973.  
  2974.  
  2975.  
  2976.    REFERENCES
  2977.  
  2978.       [GSSAPI]    J. Linn, "Generic Security Service Application Program
  2979.                   Interface", Internet-Draft draft-ietf-cat-genericsec-02,
  2980.                   August 1992.  (This Internet-Draft, like all other
  2981.                   Internet-Drafts, is not an archival document and is
  2982.                   subject to change or deletion.  It is available at the
  2983.                   time of this writing (March 1993) by anonymous ftp from
  2984.                   nnsc.nsf.net, directory internet-drafts.  Would-be
  2985.                   readers should check for successor Internet-Draft
  2986.                   versions or Internet RFCs before relying on this
  2987.                   document.)
  2988.  
  2989.       [XOM]       OSI Object Management API Specification, Version 2.0 t",
  2990.                   X.400 API Association & X/Open Company Limited, August
  2991.                   24, 1990.  Specification of datatypes and routines for
  2992.                   manipulating information objects.
  2993.  
  2994.  
  2995.    AUTHOR'S ADDRESS
  2996.  
  2997.    John Wray                       Internet email: Wray@tuxedo.enet.dec.com
  2998.    Digital Equipment Corporation                 Telephone: +1-508-486-5210
  2999.    550 King Street, LKG2-2/AA6
  3000.    Littleton, MA  01460
  3001.    USA
  3002.  
  3003.  
  3004.  
  3005.  
  3006.  
  3007.  
  3008.  
  3009.  
  3010.  
  3011.  
  3012.  
  3013.  
  3014.  
  3015.  
  3016.  
  3017.  
  3018.  
  3019.  
  3020.  
  3021.  
  3022.  
  3023.  
  3024.  
  3025.  
  3026.  
  3027.  
  3028.  
  3029.  
  3030.    Wray             Document Expiration: 31 September 1993        [Page 46]
  3031.  
  3032.  
  3033.  
  3034.  
  3035.